PHP - Wordpress Slider
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'){ 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. I bought a slider script and need to merge it in the website. What is the best to put the script in the header or in the footer? And where i have to put it on wich line? I tried a lot and i have almost no more hair left on my head! One time i managed to get the images below header but not in a slider, it added the images below each other. It's not loading jquery or something else i don't know... this is the slider script: <?php echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR...1-strict.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>JQuery-Image-Slider</title> <link href=\"css/default.css\" rel=\"stylesheet\" type=\"text/css\" /> <script src=\"js/jquery.js\" type=\"text/javascript\"></script> <script src=\"js/yslider.js\" type=\"text/javascript\"></script> <script src=\"js/init.js\" type=\"text/javascript\"></script> </head> <body> <div id=\"content\"> <div class=\"slider\"> <div class=\"sliderContent\"> <div class=\"item\"> <img src=\"img/img1.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img2.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img3.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img4.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img5.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img6.jpg\" alt=\"\" /> </div> </div> </div> </div> </body> </html> "; ?> The header and footer script are atached Attached Files footer.php 3.26KB 0 downloads header.php 16.48KB 0 downloads I have an image slider i am trying to edit. Currently i can only make it display only 1 continuios line of images that disapears. What i am trying to get, is an overflow feature that allows the images to start a new line instead of only one line. here is the code. PHP Code: (function($) { $.fn.loopedCarousel = function(options) { var defaults = { container: '.container', slides: '.slides', pagination: '.pagination', autoStart: 0, // Set to positive number for auto interval and interval time slidespeed: 300, // Speed of slide animation fadespeed: 300, // Speed of fade animation items: 6, // Items show padding: 26, // Padding between items showPagination: false, // Shows pagination links vertical: false }; this.each(function() { var obj = $(this); var o = $.extend(defaults, options); var i = o.items; var m = 0; var t = 1; var s = $(o.slides,obj).children().size(); var w = $(o.slides,obj).children().outerWidth()+o.padding; var h = $(o.slides,obj).children().outerHeight()+o.padding; var c = Math.ceil($(o.slides,obj).children().size()/i); var pd = o.padding/2; var p = 0; var u = false; var n = 0; var pt = 0; var os = i*c-s; var params = {}; if (o.vertical===true) { w = h; } if(o.showPagination){ var buttons = s/i; $(obj).append('<ul class="pagination">'); $(o.slides,obj).children().each(function(){ if (n<buttons) { $(o.pagination,obj).append('<li><a rel="'+(n+1)+'" href="#" >'+(n+1)+'</a></li>'); n = n+1; } else { n = 0; return false; } $(o.pagination+' li a:eq(0)',obj).parent().addClass('active'); }); } if (o.vertical===true) { $(o.container,obj).css({height:(w*i)}); $(o.slides,obj).css({height:(s*w)}); } else { $(o.container,obj).css({width:(w*i)}); $(o.slides,obj).css({width:(s*w)}); } $(o.slides,obj).children().each(function(){ if (o.vertical===true) { $(this).css({position:'absolute',top:p+pd,display:'block'}); } else { $(this).css({position:'absolute',left:p+pd,display:'block'}); } p=p+w; }); $(o.slides,obj).children().each(function(){ pt = pt+1; if (pt<i+1) { params[o.vertical ? 'top' : 'left'] = (-w*pt)+pd-(w*os); $(o.slides,obj).children(':eq('+(s-pt)+')').css(params); } if (pt===i+2) { pt = 0; return false; } }); $('.next',obj).click(function(){ if(u===false) { animate('next',true); if(o.autoStart){clearInterval(sliderIntervalID);} } return false; }); $('.previous',obj).click(function(){ if(u===false) { animate('prev',true); if(o.autoStart){clearInterval(sliderIntervalID);} } return false; }); $(o.pagination+' li a',obj).click(function(){ if ($(this).parent().hasClass('active')) {return false;} else { t = $(this).attr('rel'); $(o.pagination+' li a',obj).parent().siblings().removeClass('active'); $(this).parent().addClass('active'); animate('fade',t); if(o.autoStart){clearInterval(sliderIntervalID);} } return false; }); if (o.autoStart) { sliderIntervalID = setInterval(function(){ if(u===false) {animate('next',true);} }, o.autoStart); } function current(t) { if(t===c+1){t=1;} if(t===0){t=c;} $(o.pagination+' li a',obj).parent().siblings().removeClass('active'); $(o.pagination+' li a[rel="' + (t) + '"]',obj).parent().addClass('active'); } function animate(dir,clicked){ u = true; switch(dir){ case 'next': t = t+1; m = (-(t*w-w)*i); current(t); params[o.vertical ? 'top' : 'left'] = m; $(o.slides,obj).animate(params, o.slidespeed,function(){ if (t===c+1) { t = 1; params[o.vertical ? 'top' : 'left'] = 0; $(o.slides,obj).css(params,function(){ $(o.slides,obj).animate(params); }); $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = (w*pt)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); params[o.vertical ? 'top' : 'left'] = -(w*(pt+os+1)-pd); $(o.slides,obj).children(':eq('+(s-(pt+1))+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===c) { $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = w*(s+pt+os)+pd; $(o.slides,obj).children(':eq('+(pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===2) { $(o.slides,obj).children().each(function(){ pt = pt+1; if (pt<i+1) { params[o.vertical ? 'top' : 'left'] = ((w*s)+pd)-(w*pt); $(o.slides,obj).children(':eq('+(s-pt)+')').css(params); } else { pt = 0; return false; } }); } u = false; }); break; case 'prev': t = t-1; m = (-(t*w-w)*i); current(t); params[o.vertical ? 'top' : 'left'] = m; $(o.slides,obj).animate(params, o.slidespeed,function(){ if (t===0) { t = c; params[o.vertical ? 'top' : 'left'] = -w*(s-i)-(w*os); $(o.slides,obj).css(params); $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = w*(s+pt+os)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); params[o.vertical ? 'top' : 'left'] = (s*w)+pd-(pt*w)-w; $(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===2) { $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = (w*pt)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===1) { $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = -(w*pt)-w+pd-(w*os); $(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } u = false; }); break; case 'fade': t = [t]*1; m = (-(t*w-w)*i); current(t); $(o.slides,obj).children().fadeOut(o.fadespeed, function(){ params[o.vertical ? 'top' : 'left'] = m; $(o.slides,obj).css(params); $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = (pt*w)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); params[o.vertical ? 'top' : 'left'] = w*(s-pt)-w+pd; $(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); if(t===c){ $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = w*(s+pt+os)+pd; $(o.slides,obj).children(':eq('+(pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if(t===1){ $(o.slides,obj).children().each(function(){ pt = pt+1; if (pt<i+1) { params[o.vertical ? 'top' : 'left'] = -(w*pt)+pd-(w*os); $(o.slides,obj).children(':eq('+(s-pt)+')').css(params); } else { pt = 0; return false; } }); } $(o.slides,obj).children().fadeIn(o.fadespeed); u = false; }); break; default: break; } } }); }; })(jQuery); CSS Code: <div class="tabs-wrap"> <h2 class="extra-title">Products</h2> <!-- tabs begin --> <ul class="tabs"> <li><a href="#tab1">Panels</a></li> <li><a href="#tab2">Keypads</a></li> <li><a href="#tab3">Devices</a></li> <li><a href="#tab3">Manuals</a></li> </ul> </div> <div class="tab_container"> <div id="tab1" class="tab_content"> <div class="loopedCarousel"> <div class="container"> <div class="slides"> <!-- slide 1 --> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Power Series</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Alexor</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>9047</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>New Panel</strong> Spring 2011 </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Power Series</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Alexor</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>9047</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>New Panel</strong> Spring 2011 </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Power Series</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Alexor</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>9047</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>New Panel</strong> Spring 2011 </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> </div> </div> </div> </div> <div id="tab2" class="tab_content"> <div class="loopedCarousel"> <div class="container"> <div class="slides"> </div> </div> </div> </div> </div> let me know if you need any further information. thank you! This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=327718.0 Im turning a static slider revolution in a dynamic. Images are uploading and fetching perfect from Mysql DB but the texts (top-text) is showing only in the first slide. The rest is empty. Here is the Code
Any help would be great.
UPLOAD.php
<?php // Include the database configuration file include 'database/dbConfig.php'; $statusMsg = ''; // File upload path $targetDir = "uploads/"; $fileName = basename($_FILES["file"]["name"]); $top_text = filter_input(INPUT_POST, 'top_text'); $targetFilePath = $targetDir . $fileName; $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION); if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"])){ // Allow certain file formats $allowTypes = array('jpg','png','jpeg','gif','pdf'); if(in_array($fileType, $allowTypes)){ // Upload file to server if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)){ // Insert image file name into database $insert = $db->query("INSERT into images (file_name, top_text, uploaded_on) VALUES ('".$fileName."', '".$top_text."', NOW())"); if($insert){ $statusMsg = "The file ".$fileName. " has been uploaded successfully."; }else{ $statusMsg = "File upload failed, please try again."; } }else{ $statusMsg = "Sorry, there was an error uploading your file."; } }else{ $statusMsg = 'Sorry, only JPG, JPEG, PNG, GIF, & PDF files are allowed to upload.'; } }else{ $statusMsg = 'Please select a file to upload.'; } // Display status message echo $statusMsg; ?>
SLIDER <!-- Revolution slider --> <section id="slider"> <div class="tp-banner-container "> <div class="tp-banner rev-banner-fullscreen"> <ul> <!-- SLIDE --> <?php // Include the database configuration file include 'database/dbConfig.php'; // Get images from the database $query = $db->query("SELECT * FROM images ORDER BY uploaded_on DESC"); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $imageURL = 'uploads/'.$row["file_name"]; $top_text = $row['top_text']; ?> <!-- DYNAMIC SLIDE --> <li data-index="rs-140" data-transition="slideup" data-slotamount="default" data-easein="default" data-easeout="default" data-masterspeed="default" data-thumb="" data-rotate="0" data-saveperformance="off" data-title="1/2" data-description=""> <!-- MAIN IMAGE --> <img src="<?php echo $imageURL; ?>" alt="" style='background-color:#f4f4f4' alt="" width="482" height="800" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat" class="rev-slidebg" data-no-retina> <!-- LAYERS --> <!-- LAYERS 1.2 --> <div class="tp-caption tp-resizeme" id="slide-1-layer-2" data-x="['left','left','left','left']" data-hoffset="['102','102','67','40']" data-y="['top','top','top','top']" data-voffset="['150','150','60','60']" data-fontsize="['18','18','14','14']" data-width="['345','345','345','259']" data-height="none" data-whitespace="normal" data-transform_idle="o:1;" data-transform_in="y:50%;z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;opacity:0;s:900;e:Power4.easeInOut;" data-transform_out="x:-50%;opacity:0;s:800;e:Power2.easeInOut;s:300;e:Power2.easeInOut;" data-start="500" data-splitin="none" data-splitout="none" data-responsive_offset="on" style="z-index: 6; min-width: 345px; max-width: 345px; white-space: normal; color: #3e3e3e; font-family: 'Montserrat'; letter-spacing: 7px;"> <?php echo $top_text; ?> </div> <!-- /END DYNAMIC SLIDE --> </li> <?php } }else{?> <!-- DEFAULT SLIDE --> <li data-index="rs-140" data-transition="slideup" data-slotamount="default" data-easein="default" data-easeout="default" data-masterspeed="default" data-thumb="" data-rotate="0" data-saveperformance="off" data-title="1/2" data-description=""> <!-- MAIN IMAGE --> <img src="images/slide/slide-5-bg.jpg" style='background-color:#f4f4f4' alt="" width="482" height="800" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat" class="rev-slidebg" data-no-retina> <!-- LAYERS --> <!-- LAYERS 1.2 --> <div class="tp-caption tp-resizeme" id="slide-1-layer-2" data-x="['left','left','left','left']" data-hoffset="['102','102','67','40']" data-y="['top','top','top','top']" data-voffset="['150','150','60','60']" data-fontsize="['18','18','14','14']" data-width="['345','345','345','259']" data-height="none" data-whitespace="normal" data-transform_idle="o:1;" data-transform_in="y:50%;z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;opacity:0;s:900;e:Power4.easeInOut;" data-transform_out="x:-50%;opacity:0;s:800;e:Power2.easeInOut;s:300;e:Power2.easeInOut;" data-start="500" data-splitin="none" data-splitout="none" data-responsive_offset="on" style="z-index: 6; min-width: 345px; max-width: 345px; white-space: normal; color: #3e3e3e; font-family: 'Montserrat'; letter-spacing: 7px;"> New Arrival </div> <!-- /END DEFAULT SLIDE --> <?php } ?> </li> <!-- /SLIDE 1 --> </ul> </div> <!-- /tp-banner --> </div> <!-- /tp-banner-container --> </section> <!-- /#Revolution slider -->
Hi all, I have a problem I am not sure how to sort, hopefully someone here can help. I have a sliding login panel on a website that I am making. Its quite discreet. I have a stripped down version here that you can see: http://mgdesign.hostultra.com/login_test/login_test.php On the page I am making, users with a log in enter their details and will be taken to the restricted page. I would like this sliding panel to be on every page when the user is not logged in. Once they log in from the sliding panel they can still surf around all the main site pages. When they log out the session dies and it reverts to the home page. However, when they are logged in I would like the sliding login panel to disappear from the top of each page. Is there any way I can do this simply? Any help or advice would be greatly appreciated. Hey guys I am trying to link my post tilte for pagnation to the actual post. This is wordpress blog-page.php
MY SITE IS GSUEAGLENATION.COM on the homepage any of the sliders you can tell that the pagnantion titles don't link anywhere
$slider_pagination[] = get_the_title(); ------- I have tried messing around with this code and it just messesup my site
snippet EXAMPLE BELOW OF WHERE MY CODE IS PULLING <div class="pager-desc"> <span class="cs-desc"> '.$slider_title.' ---------------------------this is where my titles are showing up on my site but Its only pulling the title I want to like the title to the post </span> </div> </li>'; } echo '</ul></div>'; } px_enqueue_cycle_script(); endif; wp_reset_postdata(); \ Attached Files page_blog.php 49.11KB 4 downloads 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!
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 ****/ ?> 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
Hi, I m creating a website (Wordpress) for my client. I need a small help. 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 to work with frameworks ??? from where whould I start learning this topics ??
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"> 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 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 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 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 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. 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. |