PHP - Flash Using Php For Wordpress
Hi:
I have a wordpress, and I want to publish a flash animation.
I´ve modified the wordpress file sidebar.php with a include to this code in another .php file, but I don´t see nothing, but I don´t have any error... just "white space" instead the animation...
Can you help me with the code??
<? $wmode = "opaque"; $refererId = 258; $bannerId = 210; $width = 250; $height = 250; $link = "http://www.bellross.com/index.php?bannerId=".$bannerId."&refererId=".$refererId; $flashLink = "http://www.bellross.com/index.php?bannerId=".$bannerId."%26refererId=".$refererId; ?> <style type="text/css"> body, object { padding:0; margin:0; } #timekeeper, .link { width: <?= $width?>px; height:<?= $height?>px; } .hand { bottom: 0px; left: 107px; } </style> <link href="wp-content/themes/sahifa/template/style.css" rel="stylesheet" type="text/css"/> <script type="text/javascript"> window.onload = function() { if(document.getElementsByTagName('body')[0].style.MozTransform == '' || document.getElementsByTagName('body')[0].style.WebkitTransform == '' || document.getElementsByTagName('body')[0].style.OTransform == '' || document.getElementsByTagName('body')[0].style.transform == '') { function hand() { handS.style.MozTransform = handS.style.WebkitTransform = handS.style.OTransform = handS.style.transform = 'rotate(' + (time * 6) + 'deg)'; handM.style.MozTransform = handM.style.WebkitTransform = handM.style.OTransform = handM.style.transform = 'rotate(' + (time / 10) + 'deg)'; handH.style.MozTransform = handH.style.WebkitTransform = handH.style.OTransform = handH.style.transform = 'rotate(' + (time / 120) + 'deg)'; } var handH = document.getElementById('handH'); var handM = document.getElementById('handM'); var handS = document.getElementById('handS'); var timekeeper = document.getElementById('timekeeper'); var d = new Date(); var time = d.getSeconds() + 60 * d.getMinutes() + 3600 * d.getHours(); hand(); setInterval(function() {time = time+0.20; hand();}, 200); setInterval(function() {r = new Date(); time = r.getSeconds() + 60 * r.getMinutes() + 3600 * r.getHours(); hand()}, 10000); } }; </script> <script src="wp-content/themes/sahifa/swf/Scripts/swfobject_modified.js" type="text/javascript"></script> <script type="text/javascript"> swfobject.registerObject("FlashID"); </script> <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="<?= $width?>" height="<?= $height?>"> <param name="movie" value="wp-content/themes/sahifa/swf/timekeeper.swf"> <param name="quality" value="high"> <param name="wmode" value="<?= $wmode?>"> <param name="swfversion" value="8.0.35.0"> <param name="FlashVars" value="clickTAG=<?=$flashLink?>" /> <!-- Cette balise <param> invite les utilisateurs de Flash Player en version 6.0 r65 et ultérieure à télécharger la version la plus récente de Flash Player. Supprimez-la si vous ne voulez pas que cette invite soit visible. --> <param name="expressinstall" value="wp-content/themes/sahifa/swf/Scripts/expressInstall.swf"> <!-- La balise <object> suivante est destinée aux navigateurs autres qu'IE. Supprimez-la d'IE à l'aide d'IECC. --> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="wp-content/themes/sahifa/swf/timekeeper.swf" width="<?= $width?>" height="<?= $height?>"> <!--<![endif]--> <param name="quality" value="high"> <param name="wmode" value="<?= $wmode?>"> <param name="swfversion" value="8.0.35.0"> <param name="expressinstall" value="wp-content/themes/sahifa/swf/Scripts/expressInstall.swf"> <param name="FlashVars" value="clickTAG=<?=$flashLink?>" /> <!-- Le navigateur affichera le contenu alternatif suivant pour les utilisateurs d'un lecteur Flash de version 6.0 ou de versions plus anciennes. --> <div id="timekeeper"> <a href="<?= $link; ?>" target="_blank" class="link"></a> <img src="template/images/handH.png" class="hand" id="handH" alt="heure"/> <img src="template/images/handM.png" class="hand" id="handM" alt="minute"/> <img src="template/images/handS.png" class="hand" id="handS" alt="seconde"/> </div> <!--[if !IE]>--> </object> <!--<![endif]--> </object>Do you see anything wrong? How can I make this work in my page? I hope you can help me. Thanks. Regards Similar TutorialsI have a php tutorial that I followed for creating, inserting, selecting and updating a MySQL database with php. Everything works fine so I wanted to put it into Wordpress. I took the code and placed it into the wordpress page and everything worked just fine except the update function. Here is the tutorial I used. http://www.phpsimple.net/mysql_insert_record.html It is also the part I am having trouble with. I am able to create a record and I am also able to select a record but when I choose "update" the form doesn't load the data. It will outside the website but not inside wordpress. I am hoping this is not vague but because of my inexperience I am not sure what else to say. I will be more than happy to provide any other information you need. Hi to all gurus, Here is a small program in flash which calls values from PHP and displays them correctly. path = "http://localhost/xampp/nwjv/php/"; //declare path to php files lvOut = new LoadVars(); //create lv object sending variables OUT to php lvIn = new LoadVars(); //create lv object receiving variables IN from php lvIn.onLoad = function (success) { if(success) { //PHP variable value to textbox InVal = lvIn.returnVal; InTxt = lvIn.retVal; output.text = InVal; output1.text = InTxt; /* output1.text = "No Value"; if(InTxt == 'lo' ) { output1.text = "Low Value"; } if(InTxt == 'hi') { output1.text = "High Value"; } */ }else{ //...or notify of failure output.text = "fail"; } } myBtn.onRelease = function(){ //assign user-input value to lv property called years lvOut.years = years.text; //send to a blank window // lvOut.send(path + "dogyears_new1.php",lvIn,"GET"); lvOut.sendAndLoad(path + "dogyears_new1.php",lvIn,"GET"); }; I've been trying to use an example I got off of this forum. The PHP file works fine as a separate PHP file. When it's adding into a wp page the following results occur; Page will access db and display the list of people. Columns can be sorted by either the id or name. Existing names can be modified However; Can not add new players or delete players ANY suggestions are appreciated! <?php /**** Dealing with the database ****/ // connect to db $conn = mysql_connect('xxxxxxxxxx','yyyyyyyyyy','zzzzzzzzzzzzz') or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('ddddddddddddd',$conn) or trigger_error("SQL", E_USER_ERROR); // INSERT: if we have a name to add... if($_GET['name']) { // little bit of cleaning... $name = mysql_real_escape_string($_GET['name']); // insert new name into table $sql = "INSERT INTO info (id, name) VALUES ('','$name')"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); } // end if // UPDATE: if we have name(s) to change... if($_POST['cname']) { // for each name to change... foreach($_POST['cname'] as $cid => $cname) { // little bit of cleaning... $id = mysql_real_escape_string($cid); $name = mysql_real_escape_string($cname); // update name in the table $sql = "UPDATE info SET name = '$name' WHERE id = '$id'"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); } // end foreach } // end if // DELETE: if we have a name to delete... if($_GET['name']) { // little bit of cleaning... $name = mysql_real_escape_string($_GET['name']); // delete name from table $sql = "DELETE FROM info WHERE name = '$name'"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); } // end if // ORDERBY: if one of the links was clicked.. if ($_GET['orderby']) { // make an aray of allowed names $allowed = array('id','name'); // bit of cleaning... $order = mysql_real_escape_string($_GET['orderby']); // is it a valid column name? yes: use it. no: default to 'id' $order = (in_array($order, $allowed))? $order : "id"; // if no link clicked, default to 'id' } else { $order = "id"; } // end else // SELECT: get the list of names from database $sql = "SELECT id, name FROM info ORDER BY $order"; $result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR); /**** end deal with the database ****/ /**** list everything out ****/ // list columns echo <<<LISTCOLS <form action = '{$_SERVER['REQUEST_URI']}' method = 'post'> <table border = '1'> <tr> <td><a href = '{$_SERVER['REQUEST_URI']}?orderby=id'>id</td> <td><a href = '{$_SERVER['REQUEST_URI']}?orderby=name'>name</td> <td>delete</td> </tr> LISTCOLS; // loop through list of names while ($list = mysql_fetch_assoc($result)) { echo <<<LISTINFO <tr> <td>{$list['id']}</td> <td><input type = 'text' name = 'cname[{$list['id']}]' value = '{$list['name']}'> <td><a href = '{$_SERVER['REQUEST_URI']}?name={$list['name']}'>delete</a></td> </tr> LISTINFO; } // end while // list input box for adding new entry echo <<<NEWENTRY <tr> <td bgcolor = 'gray'></td> <td><input type = 'text' name = 'name'></td> <td bgcolor = 'gray'></td> </tr><tr> <td></td> <td align = 'center'><input type = 'submit' value = 'submit'></td> <td></td> </tr> </table> </form> NEWENTRY; /**** end list everything out ****/ ?> I am new here I dont know if I am breaching any policy by posting questions.
Are there any Tutorials that can give me input for wordpress basics such as listed here -
http://codex.wordpress.org/Plugin_API
http://codex.wordpre...Class_Reference
I would be indebted if you can help me with that.
Looking Forward. Cheers!
Hi - I'm using the WP Job Boards plugin for Wordpress. I've been given this code to create a quick search form to place in a widget. I've tried to paste the code in a sidebar widget and apparently after somebody inputs the keyword and location they should be sent to the results page which will show their results, however, it's not doing that, just showing me a 'page cannot be found' result.
Can anybody help me out with correcting the code?
<form action="<?php esc_attr_e(wpjb_link_to("http://www.littlefox...k/etsgroup/jobs")) ?>" method="GET"> Greetings all,
Been trying to make a plugin in wordpress and ran into an issue with the way wordpress makes use of ajax in the administration menu. The problem is that I completely don't understand it. I've read all the docs on it and even tried messing with a variety of tutorials on the matter to no avail.
What I am trying to do is a simple task outside of wordpress. The form has two select fields, the first field populates the second selection field. While this works fine on a standard html page, trying to do it in wordpress is another story.
Form.php:
<div id="wrapper"> <h1>Second dropdown selection based </h1> <form action="" method="post"> <p><label>Main Menu :</label> <select name="main_menu_id" id="main_menu_id"> <option value="">Select</option> <?php // Connect to database. $connect = mysqli_connect('<!--DB connection info-->"); $q = mysqli_query($connect, "SELECT cfid,cfname FROM categoryfiles ORDER BY cfid"); while($row = mysqli_fetch_array($q)) { echo '<option value="' . $row['cfname'] . '">' . $row['cfname'] . '</option>'; } ?> </select> </p> <p><label>Sub Menu: </label> <select name="sub_menu_id" id="sub_menu_id"></select> </p> </form> </div>The script.js $(function() { $("#main_menu_id").bind("change", function() { $.ajax({ type: "GET", url: "scripts/get_sub_category.php", data: "main_menu_id="+$("#main_menu_id").val(), success: function(html) { $("#sub_menu_id").html(html); } }); }); });The get_sub_category.php <?php // Connect to database. $connect = mysqli_connect('<!--My connection info-->); $id = $_GET['main_menu_id']; $q = mysqli_query($connect, "SELECT sfid, sfname FROM subjectfiles WHERE sfcategory='" . $id . "' ORDER BY sfname"); while($row = mysqli_fetch_array($q)) { echo '<option value="' . $row['sfname'] . '">' . $row['sfname'] . '</option>'; } ?>Like I said, it works just fine outside of wordpress so really I just need help getting it to work in wordpress. I just don't understand it. Thanks to anyone that takes the time to look this over. Best Regards, Nightasy This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=310048.0 What I remember from my college days is that isset check whether the variable has a value set or not and return true or false value.
However I encountered a code in wordpress -
// Set up the content width value based on the theme's design and stylesheet. Hello nice php experts :-) I've just changed the theme on my wordpress page but wish to add a couple of links to my non-wordpress pages to it. This is the line of code where I wish to add some more links. I'm going to use the page-link class to format the links but I'm not sure where I would add the extra divs in amongst all of those commas and brackets. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', '' ), 'after' => '</div>' ) ); ?> Any help is gratefully accepted. Hi
I need to add one more function in my wordpress plugin. below is the sample code working for 2nd tier. Now i need a same function for 3rd and 4th tire.
Function explanation
I am A and i refer B and if B made any sale means I (A) will get direct commission for that sale.
If B refer C and if C made any sale means (B) will get direct commission for that sale. And in this sample code me(A) also get commission for that sale as a 2nd tier.
Now C refer D and if D made any sale means © will get direct commission for that sale and (B) will get 2nd tier commission. So here (A) me too should get 3rd tire commission and i need that function.
Please help me.
function wp_aff_award_second_tier_commission($wp_aff_affiliates_db,$sale_amount,$txn_id,$item_id,$buyer_email,$buyer_name='') { global $aff_tx_msg; $clientdate = (date ("Y-m-d")); $clienttime = (date ("H:i:s")); if (get_option('wp_aff_use_2tier') && !empty($wp_aff_affiliates_db->referrer)) { $aff_tx_msg .= '<br />Using tier model'; wp_affiliate_log_debug("Using tier model",true); $award_tier_commission = true; $duration = get_option('wp_aff_2nd_tier_duration'); if(!empty($duration)) { $join_date = $wp_aff_affiliates_db->date; $days_since_joined = round((strtotime(date("Y-m-d")) - strtotime($join_date) ) / (60 * 60 * 24)); if ($days_since_joined > $duration) { $aff_tx_msg .= '<br />Tier commission award duration expried'; wp_affiliate_log_debug("Tier commission award duration expried! No tier commission will be awarded for this sale.",true); $award_tier_commission = false; } } if ($award_tier_commission) { if(!empty($wp_aff_affiliates_db->sec_tier_commissionlevel)){ $second_tier_commission_level = $wp_aff_affiliates_db->sec_tier_commissionlevel; wp_affiliate_log_debug("Using the affiliate specific 2nd tier commission for this referral. 2nd tier commission level: ".$second_tier_commission_level,true); } else{ $second_tier_commission_level = get_option('wp_aff_2nd_tier_commission_level'); wp_affiliate_log_debug("Using global 2nd tier commission for this referral. 2nd tier commission level: ".$second_tier_commission_level,true); } if (get_option('wp_aff_use_fixed_commission')) { $commission_amount = $second_tier_commission_level; } else { $commission_amount = round(($second_tier_commission_level * $sale_amount)/100,2); } $campaign_id = ""; $is_tier_comm = "yes"; global $wpdb; $aff_sales_table = WP_AFF_SALES_TBL_NAME; $updatedb = "INSERT INTO $aff_sales_table (refid,date,time,browser,ipaddress,payment,sale_amount,txn_id,item_id,buyer_email,campaign_id,buyer_name,is_tier_comm) VALUES ('$wp_aff_affiliates_db->referrer','$clientdate','$clienttime','','','$commission_amount','$sale_amount','$txn_id','$item_id','$buyer_email','$campaign_id','$buyer_name','$is_tier_comm')"; $results = $wpdb->query($updatedb); $aff_tx_msg .= '<br />Tier commission awarded to: '.$wp_aff_affiliates_db->referrer.'. Commission amount: '.$commission_amount; wp_affiliate_log_debug('Tier commission awarded to: '.$wp_aff_affiliates_db->referrer.'. Commission amount: '.$commission_amount,true); } } return $aff_tx_msg; } How to work with frameworks ??? from where whould I start learning this topics ??
Hi Everybody.
Apologies if I've not posted this in the correct forum, but the following line of WordPress code displays the ‘Title’ of my individual blog posts in the Sidebar.
<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
Can somebody please help me tweak it so it displays both the ‘Title’ and ‘Subtitle’ of each post please? So far I’ve tried adding the ‘Subtitle’ at the end, like this:
<a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?><span class="subtitle"><?php the_subtitle(); ?></span></a>
This works in the sense that both the ‘Title’ and ‘Subtitle’ are displayed (both of which are styled in slightly different colours using a separate CSS file), but while the ‘Title’ changes font colour on mouse-hover, the ‘Subtitle’ doesn’t (I’m guessing because I’ve wrapped it in a span class). What I’m really hoping to do is have the ‘Title’ displayed in one colour and the ‘Subtitle’ in a slightly different colour, but for both ‘Title’ and ‘Subtitle’ to change to the same colour when the mouse hovers over either one of them. I’m still building my site, but you can see the Sidebar as it stands, here http://www.retelevise.com.
I don’t know if this is even possible and have not had any feedback on the WordPress support forum, so was really hoping one of the PHP experts here might be able to help me please? Bear in mind I'm a complete PHP novice.
Thanks,
SN.
How do I incorporate wordpress php usage withing standard php? For example, this is typically the template used for the title in wordpress: Code: [Select] <?php the_title(); ?> How would I show that in php, like: Code: [Select] $title = the_title(); //this doesn't work by the way I placed car-dealer-website, a web application from car-dealer-website.org , in a subdirectory on my host mysite.com/car. Wordpress is public_html (mysite.com). What I am trying to do is embed mysite.com/car in Wordpress. I tried iframe and it is ugly. I looked for a php css options,using a code I found online, it didnt work but I saw hope and think php and css is the solution. What I am asking for is direction on using php and css to embed in Wordpress. I want to write code no plugins. I hope to learn some php coding. Thank you in advance for your suggestions, tutorials, different methods. Hi all, I have the following which displays my posts on a wordpress blog <?php $x = 0; while (have_posts()) : the_post(); update_post_caches($posts); $x++; ?> <li<?php if ($x % 2) { } else { echo ' class="right_col"';} ?>> <?php unset($img); if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) { $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' ); $img = $thumbURL[0]; } else { unset($img); if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); } else { if (!$img) { $img = catch_that_image($post->ID); } } } if ($img) { $img = wpzoom_wpmu($img); ?> <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&w=75&h=75&zc=1" alt="<?php the_title(); ?>" /></a><?php } ?> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a><span class="comm_bubble"><?php comments_popup_link('0', '1', '%', ' ', ' '); ?></span> <span class="meta"><?php the_time("$dateformat $timeformat"); ?> <?php edit_post_link( __('Edit', 'wpzoom'), ' ', ''); ?></span> <?php wpe_excerpt('excerpt_tabs', 'wpe_excerptmore'); ?> </li><?php endwhile; ?> </ul><?php endif; ?> What I would like to do is limit the max posts to 6, but I cant seem to work out a way of doing it! Any pointers? Cheers Hi, A page that loads a Slider on my Word Press Page loads the slider to OFF. I want It to load to ON as default Its in a php file that resides in a Plugin inside a Shortcodes directory Ive tried to change it but it seems to do nothing when i reload the page. I even deleted the file with the code in and it didnt effect the page at all? Any help would be very mutch appriciated.
if($enableGoogle == 'yes'){
Hi, I m creating a website (Wordpress) for my client. I need a small help. Hi all,
My company has a php site on wordpress that i’m trying to add google AD tracking to. Now, on the live site, when i’m logged into word-press and run the page, I can see the triggers firing fine on Tag assistant, if i un-comment the alerts, they also fire. When i log out of word-press and hit the page, nothing happens at all. No alerts, no google triggers, nothing in the php is running? Any ideas whats going on ?
<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-1234567897'); <?php $url = $_SERVER['REQUEST_URI']; if ($url =="/thankyou/") { print " gtag('event', 'conversion', {'send_to': 'AW-1234567897/1234567897', 'value': 1.0, 'currency': 'GBP' }); "; print " gtag('event', 'conversion', {'send_to': 'AW-1234567897/1234567897'}); "; //Print "alert('OK');"; //Print "alert('" . $url . "');"; } ?> </script> tia Dave Working on a website directory that includes ratings for listed companies. Trying to obtain information from database that would put some companies in a higher category than others. Or at least, I believe that is the approach I should be taking.
There are a few tricky issues.
1. Ratings are their own custom posts but are attached to company pages (parents)
2. Rating values I need to obtain are meta keys (1. total number of ratings & 2. rating average of EACH)
3. Ratings are based on four criteria which are summed and averaged for each rating submitted. As a result, values are rarely single digits such as 4 or 5 but include decimals rounded to 1 place (e.g. 4.8 or 3.5)
Additional info:
Ratings are based on 5-star system (out of 5)
Higher category would be business that achieved at least 10 ratings of 4 or more
Any help appreciated.
Hello everyone, I'm building a wordpress site, which of course is in PHP. One of the things I did was start with a template I moderately liked and have edited it until I do like it. I know the problems with debugging that this causes but I'm too far invested now to back out. One of the things I added to the header was some simple scroll-over images that have links. I created a div-id in the CSS style sheet for where this will go in the header and put in the image using the simple rollover image creator in dreamweaver. The images work fine on every page BUT the blog posts themselves. Then it's just an empty void without the images themselves. Any insight to where the problem could lie, in the header, in the pages, ect, would be really helpful. Thanks! |