PHP - Php Slider Pagnation Post Title Link
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 Similar TutorialsThis topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348057.0 Ok, so can someone edit this code: Code: [Select] <center> <table height="300px" bgcolor="#FFFF00" cellspacing="1" width="75%"> <tbody> <tr> <td> <table height="433" bgcolor="#000000" cellpadding="10px" cellspacing="1" width="995"> <tbody> <tr> <td bgcolor="#000000" valign="top" width="20%"> <div id="menu" align="right" > <a href="/forums/index.php">HOME</a> | <a href="mailto:xxxxxxx@trigamer.com">CONTACT</a> | <a href="">ABOUT (soon)</a> </div> <?php $fid = $_GET['fid']; require "global.php"; if ($_POST) { if (! trim($message) ) { // message is blank } $user = $_POST['user']; $password = $_POST['password']; $message = $_POST['message']; $title = $_POST['title']; $date = time(); $data = sprintf("INSERT INTO threads (tid, fid, title, user, dateline) VALUES (DEFAULT, $fid, '$title', '$user', $date)"); mysql_query($data); $tid = mysql_insert_id(); $data = sprintf("INSERT INTO posts VALUES (DEFAULT, $tid, '$user', '$message', $date)"); mysql_query($data); header( 'Location: replythread.php?tid='.$tid ); exit; } echo ' <font size=5><b>Add a New Post:</b></font> <form action="" method="POST" name="formpost" onsubmit="return validate();"> <table> <tr><td>Username:</td><td><input name="user" /></td></tr> <tr><td>Password (optional):</td><td><input type="password" name="password"></td></tr> <tr><td>Post Title:</td><td><input name="title" /></td></tr> <tr><td valign="top">Message: </td><td><textarea rows="10" cols="50" name="message"></textarea></td></tr> </table> <input type="submit" value=" Add new post " /> </form>'; ?> </td></tr></tbody></table></td></tr></tbody></table><br /> </center> <script> function validate() {return true; } </script> So that a tickable box can be beside "Post title" to the right of the text box that says, "Review," so that when a post is made, it will have "Review:" before the post title on the forum? Here is what the code above shows you: And this is what I want it to look like on the forums: Thanks! Hello All, I followed the very good tutorial from this site to allow me to paginate my pages. I have managed to get it working but not as I imagined so I think something is slightly wrong with my interperation. I have the number of items to show set to 15. If the number of items retrned is 16 i expected the first page to display the first 15 rows and the second page to display the last and only single row. At the moment it displays the first 15 on page 1 and the last 15 on page 2. Is this how it should work or have I coded incorrectly. Code: [Select] $sql = "SELECT COUNT(*) FROM members"; $result = mssql_query( $sql, $conn ) or die( "Err: EXE" ); $r = mssql_fetch_row($result); $numrows = $r[0]; // number of rows to show per page $rowsperpage = 15; // find out total pages $totalpages = ceil($numrows / $rowsperpage); // get the current page or set a default if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) { // cast var as int $currentpage = (int) $_GET['currentpage']; } else { // default page num $currentpage = 1; } // end if // if current page is greater than total pages... if ($currentpage > $totalpages) { // set current page to last page $currentpage = $totalpages; } // end if // if current page is less than first page... if ($currentpage < 1) { // set current page to first page $currentpage = 1; } // end if // the offset of the list, based on current page $offset = ($currentpage) * $rowsperpage; /****** build the pagination links (repeated below so displayed top and bottom of page)******/ $range = 3; // if not on page 1, don't show back links if ($currentpage > 1) { // show << link to go back to page 1 echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<[First]</a> "; // get previous page num $prevpage = $currentpage - 1; // show < link to go back to 1 page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><[Prev]</a> "; } // end if // loop to show links to range of pages around current page for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { // if it's a valid page number... if (($x > 0) && ($x <= $totalpages)) { // if we're on current page... if ($x == $currentpage) { // 'highlight' it but don't make a link echo " [<b>$x</b>] "; // if not current page... } else { // make it a link echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> "; } // end else } // end if } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>[Next]></a> "; // echo forward link for lastpage echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>[Last]>></a> "; } // end if /****** end build pagination links ******/ // get the info from the db $sqlnum = "SELECT * FROM ( SELECT TOP $rowsperpage * FROM ( SELECT TOP $offset * FROM members order by member_id ASC) AS newtbl ORDER BY member_id DESC ) AS newtbl2 ORDER BY member_id ASC"; $result = mssql_query( $sqlnum, $conn ) or die( "ERR: EXE" ); $num = mssql_num_rows ($result); if ($num !=0) { while ($row = mssql_fetch_assoc($result)) { $student_name = rtrim($row["forename"])." ".rtrim($row["surname"]); $member_id = $row["member_id"]; $profile = nl2br($row["profile"]); $list .= "<tr>"; $list .= "<th class=table colspan=2>".$member_name." (".$memebr_id.")</th>"; $list .= "</tr><tr>"; if ($row["profile"] == NULL) { $list .= "<td class=table><font color=\"red\">A profile has not been saved for this member</font></td>"; } else { $list .= "<td class=tblleft>$profile</td>"; } $list .= "<td class=table><form action=\"personal_details.php\" method=\"post\"><input type=\"hidden\" name=\"member_id\" value=\"$member_id\"><input type=\"submit\" value=\"View Detail\" class=\"submit\"></form></td>"; $list .= "</tr><tr>"; } $list .= "</table>"; echo( $list ); /****** build the pagination links ******/ // if not on page 1, don't show back links if ($currentpage > 1) { // show << link to go back to page 1 echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<[First]</a> "; // get previous page num $prevpage = $currentpage - 1; // show < link to go back to 1 page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><[Prev]</a> "; } // end if // loop to show links to range of pages around current page for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { // if it's a valid page number... if (($x > 0) && ($x <= $totalpages)) { // if we're on current page... if ($x == $currentpage) { // 'highlight' it but don't make a link echo " [<b>$x</b>] "; // if not current page... } else { // make it a link echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> "; } // end else } // end if } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>[Next]></a> "; // echo forward link for lastpage echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>[Last]>></a> "; } // end if /****** end build pagination links ******/ } else { echo ("You do not have any Members"); } Many Thanks I have a text file, named as "random.txt" with the content as like this: Quote <a href=link1.html>title-1</a> <a href=link2.html>title-2</a> <a href=link3.html>title-3</a> <a href=link4.html>title-4</a> Now in my php file, I want to randomly select & display two titles (with respective link) as like this: Code: [Select] <? $textfile ="random.txt"; $items = file("$textfile"); shuffle ($items); echo "RandLink1 : " . $items[0]; echo "<br>RandLink2 : " . $items[1]; ?> *** The result is showing as required by me. But I want to load the text file (random.txt) as like this only : Quote link1 , title-1 link2 , title-2 link3 , title-3 link4 , title-4 If I load this text file as like above (writing only the link and title names in the file), then what will be the php code to display two random titles on the result page? Thanks for your kind help. Ok I have links from different pictures and I am wanting to retrieve data from a database depending on the link clicked how would I go about doing this here is my database code. <?php // include database connection to mob database $host = "localhost"; // Host name $db_username = ""; // Mysql username $db_password = ""; // Mysql password $db_name = ""; // Database name // Connect to server and select databse. $sql = mysql_connect("$host", "$db_username", "$db_password"); // error message if (!$sql) { die('Could not connect: ' . mysql_error()); exit(); } // failure to select db else{ mysql_select_db("$db_name")or die("cannot select DB"); } // perform sql $sql = "select * from monstors where mob_name = '" . $_GET['name'] . "'"; $result = mysql_query($sql) or trigger_error($sql . '<br />' . mysql_error()); if(mysql_num_rows($result) > 0) { $row = mysql_fetch_assoc($result); $mob = new mob($row); } ?> Thanks for any advice! guys this function below posts the data into table and im also able to send a link in email with caregory name but the issue is getting the id to the particular post i got no isea how do i get that? Code: [Select] function insert($postData) { $postData['description'] = clean($postData['description']); if(!EmailExists($postData['email'])){ $sql = " INSERT INTO tbl_emails SET email = '".$postData['email']."', postersname = '".$postData['postersname']."', phone = '".$postData['phone']."' "; executeSql($sql); } if(empty($_FILES['image']["name"])){ $sql = " INSERT INTO tbl SET title = '".$postData['title']."', image = '', postersname = '".$postData['postersname']."', category = '".$postData['category']."', type = '".$postData['type']."', state = '".$postData['state']."', location = '".$postData['location']."', email = '".$postData['email']."', phone = '".$postData['phone']."', description = '".$postData['description']."', time = '".time()."' "; executeSql($sql); }else{ global $uploadPath; $remove_symbols = array('+', '=', '-', '{', '}', '$', '(', ')','&'); $removed_symbols = str_replace($remove_symbols, "_", $_FILES['image']['name']); $randomnum=rand(00000000,99999999); $imagepath = uploadFile($_FILES['image'], $uploadPath); $image = new SimpleImage(); $image->load($imagepath); $image->resize(250,280); $resize_rename = $uploadPath.$randomnum._.$removed_symbols; $image->save($resize_rename); unlink($imagepath); //delete the original file $sql = " INSERT INTO tbl SET title = '".$postData['title']."', image = '".$resize_rename."', postersname = '".$postData['postersname']."', category = '".$postData['category']."', type = '".$postData['type']."', state = '".$postData['state']."', location = '".$postData['ocation']."', email = '".$postData['email']."', phone = '".$postData['phone']."', description = '".$postData['description']."', time = '".time()."' "; executeSql($sql); } } Hey Guys. I am working with a form that shows the grand total on the checkout page. The value of the grand total is inside a hidden field. When click on submit, the _POST array doesn't get back the last value of the grand total. I need to hit the button twice to get the last value. The weird thing is when I echo the value of the grand total it display the latest value, but not with the POST array
For example. If the grand total is $10.00 and I click on submit. It will show the POST['grand_total'] as empty. If I click on submit again it will show the grand total of $10.00.
Below is my code that I am working with. Any help would be really appreciated.
if(isset($_POST['submit'])) { /* Doesn't show if i put it after if($_POST['submit'] */ if(isset($_POST['grand_total'])) { echo $_POST['grand_total']; } } //A bunch of other html/php code. Another class calculates the subtotal assigns it the variable $subtotal $cart_totals = new cartTotals($subtotal, $discounted_amount,$post_values->tip); // Cart class is shown below /* Doesn't show if i put it before if($_POST['submit'] */ if(isset($_POST['grand_total'])) { echo $_POST['grand_total']; } echo "<input name='grand_total' type='hidden' value='$cart_totals->grand_total' />"; // Shows the grand total after second from submission echo "$cart_totals->grand_total"; // Shows grand total after the first submissionCart Totals Class class cartTotals { public $subtotal; public $sales_tax; public $tip; public $grand_total; public $discount_amount; public $href_page; public $invalidCouponMessage; const TEST_ENVIORMENT = FALSE; /** * [ Function gets constructed in the order summary where the [$discount_amount= ""] arg does need to be passed. * But does get passed in when called on the checkout.php page. Therefore we set the default value to an empty string.] * @param [float] $subtotal [subtotal get passed in from the parent class coreCartFunction] * @param string $discount_amount [The class checkCouponCode calculates this discount amount based on the * subtotal and the discount amount. It gets instantiated on the clients side and passed is this construction function. * This is all done on the checkout page.] */ /*The way the construct function works is by invoking all the methods the passed arguments When the methods get invoked the do all the work and set the properties its values. The properties then get echoed out on the client side. */ function __construct($subtotal="", $discount_amount= "", $tip=""){ $this->subTotal($subtotal, $discount_amount);//SubTotal method takes the discount amount and subtracts it from the subtotal. $this->salesTax($subtotal, $discount_amount); $this->tip = $tip; $this->grandTotal(); } private function subTotal($subtotal,$discount_amount) { $rounded_subtotal = round($subtotal-$discount_amount,2); $money_format_subtotal = money_format('%i',$rounded_subtotal); $this->subtotal = $money_format_subtotal; } private function salesTax($subtotal, $discount_amount =""){ $sales_tax = (STORE_SALES_TAX)?(float)STORE_SALES_TAX:8.875; $sales_tax =(($this->subtotal)*$sales_tax)/100; $sales_tax = round($sales_tax,2); $this->sales_tax = $sales_tax; } public function Tip() { //global $post_values; //$last_tip_selected = $post_values->tip > 0 ? $post_values->tip : "" ; $tip_output = "<select id='tip' name='tip'>"; for($tip=0.00; $tip<=11.75; $tip+=0.25){ if( $tip == "2") {$selected = " selected";} else {$selected ="";} $formatted_tip = money_format('%i',$tip); $tip_output .= "<option {$selected} id='selected_tip' value='$formatted_tip'>"."$".$formatted_tip ."</option>".PHP_EOL; } $tip_output .= "</select>"; return $tip_output; } private function grandTotal(){ $grand_total = round($this->sales_tax+$this->subtotal+$this->tip,2); $grand_total_formatted = money_format('%i',$grand_total); $this->grand_total = $grand_total_formatted; } Hi,
I have a series of post to post connections. In one function, the output is a list of the linked post to posts. Here is an example: function countryJob(){ global $post;
$echo = f_print(array( echo '<div class="country-job-text">'.$echo.'</div>';
job, location and city are all post types that can be connected.
I want to create the same as above to create a list of the cites connected to a location (locations are the name for posts which are countries)
How do I discover the connection type and post type needed to create this output? $post='{"cart_items":[{"configuration":{"price":100,"recharge_number":"9999999999"},"product_id":"999","qty":1}]}';i try this n reslut was :There are no valid items in cart: help me plz Edited by ShivaGupta, 30 November 2014 - 01:11 AM. I'm learning PHP, and in the course of this, I'm writing a little app which posts to the same php file. HOWEVER, when I run the app again, the POST values remain. I can use unset() but, is there another way to clear POST data? RON ok i want to be able to delete the post only if there the one who posted aka blabbed here is the script , please help. if im not clear please tell me! Code: [Select] <?php // Start_session, check if user is logged in or not, and connect to the database all in one included file include_once("scripts/checkuserlog.php"); if (!$_SESSION['idx']) { $msgToUser = '<br /><br /><font color="#FF0000">Sorry but you must be logged in to view this page!</font><p><br><div align="right"><a href="register.php">Join Here</a></div><form id="signinform" action="login.php" method="post" enctype="multipart/form-data" name="signinform"> <fieldset> <legend>Log in</legend> <label for="login">Email</label> <input type="text" id="email" name="email" /> <div class="clear"></div> <label for="password">Password</label> <input type="password" id="password" name="pass" /> <div class="clear"></div> <label for="remember_me" style="padding: 0;">Remember me?</label> <input type="checkbox" id="remember" style="position: relative; top: 3px; margin: 0; " name="remember"/ value="yes" checked="checked"> <div class="clear"></div> <br /> <input type="submit" style="margin: -20px 0 0 287px;" class="button" name="commit" value="Sign In"/> </fieldset> </form></p>'; include_once 'msgToUser.php'; exit(); } else if ($logOptions_id != $_SESSION['id']) { $msgToUser = '<br /><br /><font color="#FF0000">Only site members can do that</font><p><a href="register.php">Join Here</a></p>'; include_once 'msgToUser.php'; exit(); } // Include the class files for auto making links out of full URLs and for Time Ago date formatting include_once("wi_class_files/autoMakeLinks.php"); include_once ("wi_class_files/agoTimeFormat.php"); // Create the two new objects before we can use them below in this script $activeLinkObject = new autoActiveLink; $myObject = new convertToAgo; ?> <?php // ------- INITIALIZE SOME VARIABLES --------- // they must be initialized in some server environments or else errors will get thrown $id = ""; $username = ""; $firstname = ""; $lastname = ""; $mainNameLine = ""; $country = ""; $state = ""; $city = ""; $zip = ""; $bio_body = ""; $website = ""; $youtube = ""; $facebook = ""; $twitter = ""; $twitterWidget = ""; $locationInfo = ""; $user_pic = ""; $blabberDisplayList = ""; $interactionBox = ""; $cacheBuster = rand(999999999,9999999999999); // Put on an image URL will help always show new when changed // ------- END INITIALIZE SOME VARIABLES --------- // ------- ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS --------- if (isset($_GET['id'])) { $id = preg_replace('#[^0-9]#i', '', $_GET['id']); // filter everything but numbers } else if (isset($_SESSION['idx'])) { $id = $logOptions_id; } else { header("location: index.php"); exit(); } // ------- END ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS --------- // ------- FILTER THE ID AND QUERY THE DATABASE -------- $id = preg_replace('#[^0-9]#i', '', $id); // filter everything but numbers on the ID just in case $sql = mysql_query("SELECT * FROM myMembers WHERE id='$id' LIMIT 1"); // query the member // ------- FILTER THE ID AND QUERY THE DATABASE -------- // ------- MAKE SURE PERSON EXISTS IN DATABASE --------- $existCount = mysql_num_rows($sql); // count the row nums if ($existCount == 0) { // evaluate the count header("location: index.php?msg=user_does_not_exist"); exit(); } // ------- END MAKE SURE PERSON EXISTS IN DATABASE --------- // ------- WHILE LOOP FOR GETTING THE MEMBER DATA --------- while($row = mysql_fetch_array($sql)){ $username = $row["username"]; $firstname = $row["firstname"]; $lastname = $row["lastname"]; $country = $row["country"]; $state = $row["state"]; $city = $row["city"]; $sign_up_date = $row["sign_up_date"]; $sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date)); $last_log_date = $row["last_log_date"]; $last_log_date = strftime("%b %d, %Y", strtotime($last_log_date)); $bio_body = $row["bio_body"]; $bio_body = str_replace("'", "'", $bio_body); $bio_body = stripslashes($bio_body); $website = $row["website"]; $youtube = $row["youtube"]; $facebook = $row["facebook"]; $twitter = $row["twitter"]; $friend_array = $row["friend_array"]; /////// Mechanism to Display Pic. See if they have uploaded a pic or not ////////////////////////// $check_pic = "members/$id/image01.jpg"; $default_pic = "members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic?$cacheBuster\" width=\"218px\" />"; } else { $user_pic = "<img src=\"$default_pic\" width=\"218px\" />"; } /////// Mechanism to Display Real Name Next to Username - real name(username) ////////////////////////// if ($firstname != "") { $mainNameLine = "$firstname $lastname ($username)"; $username = $firstname; } else { $mainNameLine = $username; } /////// Mechanism to Display Youtube channel link or not ////////////////////////// if ($youtube == "") { $youtube = ""; } else { $youtube = '<br /><br /><img src="images/youtubeIcon.jpg" width="18" height="12" alt="Youtube Channel for ' . $username . '" /> <strong>YouTube Channel:</strong><br /><a href="http://www.youtube.com/user/' . $youtube . '" target="_blank">youtube.com/' . $youtube . '</a>'; } /////// Mechanism to Display Facebook Profile link or not ////////////////////////// if ($facebook == "") { $facebook = ""; } else { $facebook = '<br /><br /><img src="images/facebookIcon.jpg" width="18" height="12" alt="Facebook Profile for ' . $username . '" /> <strong>Facebook Profile:</strong><br /><a href="http://www.facebook.com/profile.php?id=' . $facebook . '" target="_blank">profile.php?id=' . $facebook . '</a>'; } /////// Mechanism to Display Twitter Tweet Widget or not ////////////////////////// if ($twitter == "") { $twitterWidget = ""; } else { $twitterWidget = "<script src=\"http://widgets.twimg.com/j/2/widget.js\"></script> <script> new TWTR.Widget({ version: 2, type: 'profile', rpp: 5, interval: 6000, width: 218, height: 160, theme: { shell: { background: '#BDF', color: '#000000' }, tweets: { background: '#ffffff', color: '#000000', links: '#0066FF', } }, features: { scrollbar: true, loop: false, live: false, hashtags: true, timestamp: true, avatars: false, behavior: 'all' } }).render().setUser('$twitter').start(); </script>"; } /////// Mechanism to Display Website URL or not ////////////////////////// if ($website == "") { $website = ""; } else { $website = '<br /><br /><img src="images/websiteIcon.jpg" width="18" height="12" alt="Website URL for ' . $username . '" /> <strong>Website:</strong><br /><a href="http://' . $website . '" target="_blank">' . $website . '</a>'; } /////// Mechanism to Display About me text or not ////////////////////////// if ($bio_body == "") { $bio_body = ""; } else { $bio_body = '<div class="infoBody">' . $bio_body . '</div>'; } /////// Mechanism to Display Location Info or not ////////////////////////// if ($country == "" && $state == "" && $city == "") { $locationInfo = ""; } else { $locationInfo = "$city · $state<br />$country ".'<a href="#" onclick="return false" onmousedown="javascript:toggleViewMap(\'google_map\');">view map</a>'; } } // close while loop // ------- END WHILE LOOP FOR GETTING THE MEMBER DATA --------- // ------- POST NEW BLAB TO DATABASE --------- $blab_outout_msg = ""; if (isset($_POST['blab_field']) && $_POST['blab_field'] != "" && $_POST['blab_field'] != " "){ $blabWipit = $_POST['blabWipit']; $sessWipit = base64_decode($_SESSION['wipit']); if (!isset($_SESSION['wipit'])) { } else if ($blabWipit == $sessWipit) { // Delete any blabs over 50 for this member $sqlDeleteBlabs = mysql_query("SELECT * FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 50"); $bi = 1; while ($row = mysql_fetch_array($sqlDeleteBlabs)) { $blad_id = $row["id"]; if ($bi > 20) { $deleteBlabs = mysql_query("DELETE FROM blabbing WHERE id='$blad_id'"); } $bi++; } // End Delete any blabs over 20 for this member $blab_field = $_POST['blab_field']; $blab_field = stripslashes($blab_field); $blab_field = strip_tags($blab_field); $blab_field = mysql_real_escape_string($blab_field); $blab_field = str_replace("'", "'", $blab_field); $sql = mysql_query("INSERT INTO blabbing (mem_id, the_blab, blab_date) VALUES('$id','$blab_field', now())") or die (mysql_error()); $blab_outout_msg = ""; } } // ------- END POST NEW BLAB TO DATABASE --------- // ------- MEMBER BLABS OUTPUT CONSTRUCTION --------- /////// Mechanism to Display Pic if (file_exists($check_pic)) { $blab_pic = '<div style="overflow:hidden; height:40px;"><a href="profile.php?id=' . $id . '"><img src="' . $check_pic . '" width="40px" border="0" /></a></div>'; } else { $blab_pic = '<div style="overflow:hidden; height:40px;"><a href="profile.php?id=' . $id . '"><img src="' . $default_pic . '" width="40px" border="0" /></a></div>'; } /////// END Mechanism to Display Pic $sql_blabs = mysql_query("SELECT id, mem_id, the_blab, blab_date FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 20"); while($row = mysql_fetch_array($sql_blabs)){ $blabid = $row["id"]; $uid = $row["mem_id"]; $the_blab = $row["the_blab"]; $the_blab = ($activeLinkObject -> makeActiveLink($the_blab)); $blab_date = $row["blab_date"]; $convertedTime = ($myObject -> convert_datetime($blab_date)); $whenBlab = ($myObject -> makeAgo($convertedTime)); $blabberDisplayList .= ' <table style="background-color:#FFF; border:#999 1px solid; border-top:none;" cellpadding="5" width="100%"> <tr> <td width="10%" valign="top">' . $blab_pic . '</td> <td width="90%" valign="top" style="line-height:1.5em;"><span class="greenColor textsize10">' . $whenBlab . ' <a href="profile.php?id=' . $uid . '">' . $username . '</a> said:</span><br /> ' . $the_blab . '</td> </tr></table>'; } // ------- END MEMBER BLABS OUTPUT CONSTRUCTION --------- // ------- ESTABLISH THE PROFILE INTERACTION TOKEN --------- $thisRandNum = rand(9999999999999,999999999999999999); $_SESSION['wipit'] = base64_encode($thisRandNum); // Will always overwrite itself each time this script runs // ------- END ESTABLISH THE PROFILE INTERACTION TOKEN --------- // ------- EVALUATE WHAT CONTENT TO PLACE IN THE MEMBER INTERACTION BOX ------------------- // initialize some output variables $friendLink = ""; $the_blab_form = ""; if (isset($_SESSION['idx']) && $logOptions_id != $id) { // If SESSION idx is set, AND it does not equal the profile owner's ID // SQL Query the friend array for the logged in viewer of this profile if not the owner $sqlArray = mysql_query("SELECT friend_array FROM myMembers WHERE id='" . $logOptions_id ."' LIMIT 1"); while($row=mysql_fetch_array($sqlArray)) { $iFriend_array = $row["friend_array"]; } $iFriend_array = explode(",", $iFriend_array); if (in_array($id, $iFriend_array)) { $friendLink = '<a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'remove_friend\');">Remove Friend</a>'; } else { $friendLink = '<a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'add_friend\');">Add as Friend</a>'; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $interactionBox = '<br /><br /><div class="interactionLinksDiv"> ' . $friendLink . ' <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'private_message\');">Private Message</a> </div><br />'; $the_blab_form = '<div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <textarea name="blab_field" rows="3" style="width:99%;"></textarea> <strong>Write on ' . $username . '\'s Board (coming soon)</strong> </div>'; } else if (isset($_SESSION['idx']) && $logOptions_id == $id) { // If SESSION idx is set, AND it does equal the profile owner's ID $interactionBox = '<br /><br /><div class="interactionLinksDiv"> <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'friend_requests\');">Friend Requests</a> </div><br />'; $the_blab_form = ' ' . $blab_outout_msg . ' <div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <form action="profile.php" method="post" enctype="multipart/form-data" name="blab_from"> <textarea name="blab_field" rows="3" style="width:99%;"></textarea> <input name="blabWipit" type="hidden" value="' . $thisRandNum . '" /> <strong>Blab away ' . $username . '</strong> (220 char max) <input name="submit" type="submit" value="Blab" /> <div align="right"> </form></div>'; } else { // If no SESSION id is set, which means we have a person who is not logged in $interactionBox = '<div style="border:#CCC 1px solid; padding:5px; background-color:#E4E4E4; color:#999; font-size:11px;"> <a href="register.php">Sign Up</a> or <a href="login.php">Log In</a> to interact with ' . $username . ' </div>'; $the_blab_form = '<div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <textarea name="blab_field" rows="3" style="width:99%;"></textarea> <a href="register.php">Sign Up</a> or <a href="login.php">Log In</a> to write on ' . $username . '\'s Board </div>'; } // ------- END EVALUATE WHAT CONTENT TO PLACE IN THE MEMBER INTERACTION BOX ------------------- // ------- POPULATE FRIEND DISPLAY LISTS IF THEY HAVE AT LEAST ONE FRIEND ------------------- $friendList = ""; $friendPopBoxList = ""; if ($friend_array != "") { // ASSEMBLE FRIEND LIST AND LINKS TO VIEW UP TO 6 ON PROFILE $friendArray = explode(",", $friend_array); $friendCount = count($friendArray); $friendArray6 = array_slice($friendArray, 0, 6); $friendList .= '<div class="infoHeader">' . $username . '\'s Friends (<a href="#" onclick="return false" onmousedown="javascript:toggleViewAllFriends(\'view_all_friends\');">' . $friendCount . '</a>)</div>'; $i = 0; // create a varible that will tell us how many items we looped over $friendList .= '<div class="infoBody" style="border-bottom:#666 1px solid;"><table id="friendTable" align="center" cellspacing="4"></tr>'; foreach ($friendArray6 as $key => $value) { $i++; // increment $i by one each loop pass $check_pic = 'members/' . $value . '/image01.jpg'; if (file_exists($check_pic)) { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="' . $check_pic . '" width="54px" border="1"/></a>'; } else { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="members/0/image01.jpg" width="54px" border="1"/></a> '; } $sqlName = mysql_query("SELECT username, firstname FROM myMembers WHERE id='$value' LIMIT 1") or die ("Sorry we had a mysql error!"); while ($row = mysql_fetch_array($sqlName)) { $friendUserName = substr($row["username"],0,12); $friendFirstName = substr($row["firstname"],0,12);} if (!$friendUserName) {$friendUserName = $friendFirstName;} // If username is blank use the firstname... programming changes in v1.32 call for this if ($i % 6 == 4){ $friendList .= '<tr><td><div style="width:56px; height:68px; overflow:hidden;" title="' . $friendUserName . '"> <a href="profile.php?id=' . $value . '">' . $friendUserName . '</a><br />' . $frnd_pic . ' </div></td>'; } else { $friendList .= '<td><div style="width:56px; height:68px; overflow:hidden;" title="' . $friendUserName . '"> <a href="profile.php?id=' . $value . '">' . $friendUserName . '</a><br />' . $frnd_pic . ' </div></td>'; } } $friendList .= '</tr></table> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleViewAllFriends(\'view_all_friends\');">view all</a></div> </div>'; // END ASSEMBLE FRIEND LIST... TO VIEW UP TO 6 ON PROFILE // ASSEMBLE FRIEND LIST AND LINKS TO VIEW ALL(50 for now until we paginate the array) $i = 0; $friendArray50 = array_slice($friendArray, 0, 50); $friendPopBoxList = '<table id="friendPopBoxTable" width="100%" align="center" cellpadding="6" cellspacing="0">'; foreach ($friendArray50 as $key => $value) { $i++; // increment $i by one each loop pass $check_pic = 'members/' . $value . '/image01.jpg'; if (file_exists($check_pic)) { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="' . $check_pic . '" width="54px" border="1"/></a>'; } else { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="members/0/image01.jpg" width="54px" border="1"/></a> '; } $sqlName = mysql_query("SELECT username, firstname, country, state, city FROM myMembers WHERE id='$value' LIMIT 1") or die ("Sorry we had a mysql error!"); while ($row = mysql_fetch_array($sqlName)) { $funame = $row["username"]; $ffname = $row["firstname"]; $fcountry = $row["country"]; $fstate = $row["state"]; $fcity = $row["city"]; } if (!$funame) {$funame = $ffname;} // If username is blank use the firstname... programming changes in v1.32 call for this if ($i % 2) { $friendPopBoxList .= '<tr bgcolor="#F4F4F4"><td width="14%" valign="top"> <div style="width:56px; height:56px; overflow:hidden;" title="' . $funame . '">' . $frnd_pic . '</div></td> <td width="86%" valign="top"><a href="profile.php?id=' . $value . '">' . $funame . '</a><br /><font size="-2"><em>' . $fcity . '<br />' . $fstate . '<br />' . $fcountry . '</em></font></td> </tr>'; } else { $friendPopBoxList .= '<tr bgcolor="#E0E0E0"><td width="14%" valign="top"> <div style="width:56px; height:56px; overflow:hidden;" title="' . $funame . '">' . $frnd_pic . '</div></td> <td width="86%" valign="top"><a href="profile.php?id=' . $value . '">' . $funame . '</a><br /><font size="-2"><em>' . $fcity . '<br />' . $fstate . '<br />' . $fcountry . '</em></font></td> </tr>'; } } $friendPopBoxList .= '</table>'; // END ASSEMBLE FRIEND LIST AND LINKS TO VIEW ALL(50 for now until we paginate the array) } // ------- END POPULATE FRIEND DISPLAY LISTS IF THEY HAVE AT LEAST ONE FRIEND ------------------- ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="Description" content="Profile for <?php echo "$username"; ?>" /> <meta name="Keywords" content="<?php echo "$username, $city, $state, $country"; ?>" /> <meta name="rating" content="General" /> <meta name="ROBOTS" content="All" /> <title>Site Profile for <?php echo "$username"; ?></title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.png" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.png" type="image/x-icon" /> <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <style type="text/css"> <!-- .infoHeader { background-color: #BDF; font-size:11px; font-weight:bold; padding:8px; border: #999 1px solid; border-bottom:none; width:200px; } .infoBody{ background-color: #FFF; font-size:11px; padding:8px; border: #999 1px solid; border-bottom:none; width:200px; } /* ------- Interaction Links Class -------- */ .interactionLinksDiv a { border:#B9B9B9 1px solid; padding:5px; color:#060; font-size:11px; background-image:url(style/headerBtnsBG.jpg); text-decoration:none; } .interactionLinksDiv a:hover { border:#090 1px solid; padding:5px; color:#060; font-size:11px; background-image:url(style/headerBtnsBGover.jpg); } /* ------- Interaction Containers Class -------- */ .interactContainers { padding:8px; background-color:#BDF; border:#999 1px solid; display:none; } #add_friend_loader { display:none; } #remove_friend_loader { display:none; } #interactionResults { display:none; font-size:16px; padding:8px; } #friendTable td{ font-size:9px; } #friendTable td a{ color:#03C; text-decoration:none; } #view_all_friends { background-image:url(style/opaqueDark.png); width:270px; padding:20px; position:fixed; top:150px; display:none; z-index:100; margin-left:50px; } #google_map { background-image:url(style/opaqueDark.png); padding:20px; position:fixed; top:150px; display:none; z-index:100; margin-left:50px; } --> </style> <script language="javascript" type="text/javascript"> // jQuery functionality for toggling member interaction containers function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } function toggleViewAllFriends(x) { if ($('#'+x).is(":hidden")) { $('#'+x).fadeIn(200); } else { $('#'+x).fadeOut(200); } } function toggleViewMap(x) { if ($('#'+x).is(":hidden")) { $('#'+x).fadeIn(200); } else { $('#'+x).fadeOut(200); } } // Friend adding and accepting stuff var thisRandNum = "<?php echo $thisRandNum; ?>"; var friendRequestURL = "scripts_for_profile/request_as_friend.php"; function addAsFriend(a,b) { $("#add_friend_loader").show(); $.post(friendRequestURL,{ request: "requestFriendship", mem1: a, mem2: b, thisWipit: thisRandNum } ,function(data) { $("#add_friend").html(data).show().fadeOut(12000); }); } function acceptFriendRequest (x) { $.post(friendRequestURL,{ request: "acceptFriend", reqID: x, thisWipit: thisRandNum } ,function(data) { $("#req"+x).html(data).show(); }); } function denyFriendRequest (x) { $.post(friendRequestURL,{ request: "denyFriend", reqID: x, thisWipit: thisRandNum } ,function(data) { $("#req"+x).html(data).show(); }); } // End Friend adding and accepting stuff // Friend removal stuff function removeAsFriend(a,b) { $("#remove_friend_loader").show(); $.post(friendRequestURL,{ request: "removeFriendship", mem1: a, mem2: b, thisWipit: thisRandNum } ,function(data) { $("#remove_friend").html(data).show().fadeOut(12000); }); } // End Friend removal stuff // Start Private Messaging stuff $('#pmForm').submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');}); function sendPM ( ) { var pmSubject = $("#pmSubject"); var pmTextArea = $("#pmTextArea"); var sendername = $("#pm_sender_name"); var senderid = $("#pm_sender_id"); var recName = $("#pm_rec_name"); var recID = $("#pm_rec_id"); var pm_wipit = $("#pmWipit"); var url = "scripts_for_profile/private_msg_parse.php"; if (pmSubject.val() == "") { $("#interactionResults").html('<img src="images/round_error.png" alt="Error" width="31" height="30" /> Please type a subject.').show().fadeOut(6000); } else if (pmTextArea.val() == "") { $("#interactionResults").html('<img src="images/round_error.png" alt="Error" width="31" height="30" /> Please type in your message.').show().fadeOut(6000); } else { $("#pmFormProcessGif").show(); $.post(url,{ subject: pmSubject.val(), message: pmTextArea.val(), senderName: sendername.val(), senderID: senderid.val(), rcpntName: recName.val(), rcpntID: recID.val(), thisWipit: pm_wipit.val() } , function(data) { $('#private_message').slideUp("fast"); $("#interactionResults").html(data).show().fadeOut(10000); document.pmForm.pmTextArea.value=''; document.pmForm.pmSubject.value=''; $("#pmFormProcessGif").hide(); }); } } // End Private Messaging stuff </script> </head> <body> <?php include_once "header_template.php"; ?> <table class="mainBodyTable" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="738" valign="top"><br /> <table width="98%" border="0" align="center" cellpadding="6"> <tr> <td width="33%" valign="top"> <?php echo $user_pic; ?> <?php echo $bio_body; ?> <div class="infoHeader"><?php echo $username; ?>'s Information</div> <div class="infoBody"> <?php echo $locationInfo; ?> <?php echo $website; ?> <?php echo $youtube; ?> <?php echo $facebook; ?> </div> <?php echo $friendList; ?> <div id="view_all_friends"> <div align="right" style="padding:6px; background-color:#FFF; border-bottom:#666 1px solid;"> <div style="display:inline; font-size:14px; font-weight:bold; margin-right:150px;">All Friends</div> <a href="#" onclick="return false" onmousedown="javascript:toggleViewAllFriends('view_all_friends');">close </a> </div> <div style="background-color:#FFF; height:240px; overflow:auto;"> <?php echo $friendPopBoxList; ?> </div> <div style="padding:6px; background-color:#000; border-top:#666 1px solid; font-size:10px; color: #0F0;"> Temporary programming shows 50 maximum. Navigating through the full list is coming soon. </div> </div> <?php echo $twitterWidget; ?> <div class="infoBody" style="border-bottom:#999 1px solid;"><?php include_once("ad_200_square.php"); ?></div> </td> <td width="67%" valign="top"> <span style="font-size:16px; font-weight:800;"><?php echo $mainNameLine; ?></span> <?php echo $interactionBox; ?> <div class="interactContainers" id="add_friend"> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('add_friend');">cancel</a> </div> Add <?php echo "$username"; ?> as a friend? <a href="#" onclick="return false" onmousedown="javascript:addAsFriend(<?php echo $logOptions_id; ?>, <?php echo $id; ?>);">Yes</a> <span id="add_friend_loader"><img src="images/loading.gif" width="28" height="10" alt="Loading" /></span> </div> <div class="interactContainers" id="remove_friend"> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('remove_friend');">cancel</a> </div> Remove <?php echo "$username"; ?> from your friend list? <a href="#" onclick="return false" onmousedown="javascript:removeAsFriend(<?php echo $logOptions_id; ?>, <?php echo $id; ?>);">Yes</a> <span id="remove_friend_loader"><img src="images/loading.gif" width="28" height="10" alt="Loading" /></span> </div> <!-- START DIV that serves as an interaction status and results container that only appears when we instruct it to --> <div id="interactionResults" style="font-size:15px; padding:10px;"></div> <!-- END DIV that serves as an interaction status and results container that only appears when we instruct it to --> <!-- START DIV that contains the Private Message form --> <div class="interactContainers" id="private_message"> <form action="javascript:sendPM();" name="pmForm" id="pmForm" method="post"> <font size="+1">Sending Private Message to <strong><em><?php echo "$username"; ?></em></strong></font><br /><br /> Subject: <input name="pmSubject" id="pmSubject" type="text" maxlength="64" style="width:98%;" /> Message: <textarea name="pmTextArea" id="pmTextArea" rows="8" style="width:98%;"></textarea> <input name="pm_sender_id" id="pm_sender_id" type="hidden" value="<?php echo $_SESSION['id']; ?>" /> <input name="pm_sender_name" id="pm_sender_name" type="hidden" value="<?php echo $_SESSION['username']; ?>" /> <input name="pm_rec_id" id="pm_rec_id" type="hidden" value="<?php echo $id; ?>" /> <input name="pm_rec_name" id="pm_rec_name" type="hidden" value="<?php echo $username; ?>" /> <input name="pmWipit" id="pmWipit" type="hidden" value="<?php echo $thisRandNum; ?>" /> <span id="PMStatus" style="color:#F00;"></span> <br /><input name="pmSubmit" type="submit" value="Submit" /> or <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('private_message');">Close</a> <span id="pmFormProcessGif" style="display:none;"><img src="images/loading.gif" width="28" height="10" alt="Loading" /></span></form> </div> <!-- END DIV that contains the Private Message form --> &n 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! 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'){ This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=327718.0 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. 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 -->
I've tried mysql_error(), yet nothing is displayed, but I'm pretty sure it may be something wrong with my query. After someone inputs their new information, site title in the database is changed to 0, and description isn't updated at all.., but it's still the same data as before and isn't changed. if(!$_POST['title'] || !$_POST['description']) { echo " <table><form action='account.php' method='POST'> <input type='hidden' name='edit' value='1'> <tr><td>Site Name</td><td><input type='text' name='title' value='". $grab['title'] ."'></td></tr> <tr><td>Site Description</td><td><textarea name='description' rows='18' cols='40' maxlength='550'>". $grab['description'] ."</textarea></td></tr> <tr><td>Finished?</td><td><input type='submit' value='Update Information'></td></tr> </form></table>"; } else { $title = mysql_real_escape_string(strip_tags($_POST['title'])); $description = mysql_real_escape_string($_POST['description']); $to_censor = array("fag", "ass", "asshole", "douchebag", "dumbass"); $new = str_replace($to_censor, "****", $description); $description = strip_tags($new, "<b><i><a>"); mysql_query("UPDATE sites SET title = '$title' AND description = '$description' WHERE username = '". $_SESSION['user'] ."'") or die(mysql_error()); echo "Updated information successfully. <a href='account.php'>Back to My Account</a>"; } |