Jump to content

cmb

Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by cmb

  1. this is my upload script which i found on the www3school site form: <form method="post" action="prod_update.php" enctype="multipart/form-data"> <label for="product">Product : <input type="text" id="product" name="product" value="<?php echo $row['Product']?>" /> </label> </td></tr><tr><td> <label for="price">Price : <input type="text" id="price" name="price" value="<?php echo $row['Price']?>" /> </label> </td></tr><tr><td> <label for="file">Picture : <input type="file" name="file" id="file" accept="image/*" /> </label> </td></tr><tr><td> <input type="submit" value="Update" /> </td></tr> </form> upload script: <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg"))) //&& ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../images/products/" . $_FILES["file"]["name"]); echo "Stored in: " . "images/products/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?> when i run this in chrome it works no problem but wen i run it in IE i get this Notice: Undefined index: file in C:\xampp\htdocs\Register\admin\prod_update.php on line 2 Notice: Undefined index: file in C:\xampp\htdocs\Register\admin\prod_update.php on line 3 Notice: Undefined index: file in C:\xampp\htdocs\Register\admin\prod_update.php on line 4 Invalid file
  2. i don't know how to write this <a href='#' onclick="toggle_visibility('login');" style='color:white'>Login</a> inside and echo so it works right because for the onclick to work right it has to be in double quote's and not single so this doesn't work <?php echo "<a href='#' onclick='toggle_visibility('login');' style='color:white'>Login</a>"; ?>
  3. i have this login in system the login page is in a folder called login with a couple other files related to a login system. when a user logs in the php creates several cookies and is suppose to redirect to another page which is in a separate folder. on the page you are suppose to get redirected to, it calls a file that checks to see if the user is loged on by checking some cookies against the database but the cookies aren't their anymore even though they were set. here is the login script <?php require('database.php'); //Include DB connection information if (isset($_POST['login'])) { //Execute the following if form is submitted $ip = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]); //Geet user's IP Address $email = mysql_real_escape_string($_POST['email']); //Post email from form $password = mysql_real_escape_string(sha1(md5($_POST['pass']))); //Post password from form and encrypt if (empty($email) || empty($password)) { //Check for empty fields die("<b>Error:</b> All fields are required to be filled in."); } $check = mysql_query("SELECT * FROM users WHERE email = '$email'") or die(mysql_error()); $check2 = mysql_num_rows($check); if ($check2 == 0) { //Check if account exists die("<b>Error:</b> Email and password do not match the database."); } $row = mysql_fetch_array($check); $key = $row['key']; $ppas = $password . $key; $db_password = $row['password']; if ($ppas != $db_password) { //Check if password is correct die("<b>Error:</b> Email and password do not match the database."); } $allowed = $row['pp']; if ($allowed != 1) { //Check if they have permission die("<b>Error:</b> You do not have permission to view this section."); } function randomstring($length = 10) { $validCharacters = "abcdefghijklmnopqrstuxyvwz1234567890"; $validCharNumber = strlen($validCharacters); $result = ""; for ($i = 0; $i < $length; $i++) { $index = mt_rand(0, $validCharNumber - 1); $result .= $validCharacters[$index]; } return $result; } $session = randomstring(); $pas = $password . $key; mysql_query("UPDATE users SET session_id='$session' WHERE email='$email' AND password='$pas' ") or die(mysql_error()); //Add session ID to DB mysql_query("UPDATE users SET login_ip='$ip' WHERE email='$email' AND password='$pas'") or die(mysql_error()); //Add login IP to DB $level = $row['accounttype']; $pp = $row['pp']; $fs = $row['fs']; $fam = $row['fam']; $fname = $row['firstname']; $gbsa = $row['gbsa']; $future = time() + 1209600; setcookie("uemail", $email, $future); //Set cookie containing username setcookie("sessionid", $session, $future); //Set cookie containging session ID setcookie("acounttype", $level, $future); setcookie("pp", $pp, $future); setcookie("fs", $fs, $future); setcookie("fam", $fam, $future); setcookie("gbsa", $gbsa, $future); setcookie("name", $fname, $future); ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// $page = mysql_real_escape_string($_GET['page']); if ($page == 1){ header("Location: ../pinkpanthers/index.php"); //Redirect to members page }else{ header("Location: ../main.php"); } }else { //If form is not submitted display the form echo<<<login <center> <h1>Log In </h1> <h2>Or GO <a href="../main.php">Home</a></h2> <form method="post" action=""> Email: <input type="text" name="email"><br> Password: <input type="password" name="pass"><br> <input type="submit" name="login" value="Login"><br><br> </form></center> login; } ?> and here is the check login page <?php require('../login/database.php'); //Include DB connection information $ip = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]); //Get user's IP Address $email = mysql_real_escape_string($_COOKIE['uemail']); //Get username stored in cookie $pp = mysql_real_escape_string($_COOKIE['pp']); if ($pp == 1){ $sessionid = mysql_real_escape_string($_COOKIE['sessionid']); //Get user's session ID $query = "SELECT * FROM `users` WHERE `email` = '$email' AND `session_id` = '$sessionid' AND `login_ip` = '$ip' AND `pp` = '1' "; $check = mysql_query($query) or die(mysql_error()); //Check if all information provided from the user is valid by checking in the DB $answer = mysql_num_rows($check); //Return number of results found. Equal to 0 if not logged in or 1 if logged in. if ($answer == 0 || $sessionid == '') { //Check if login is valid. If not redirect user to login page header('Location: ../login/login.php?page=1'); exit(); } $row = mysql_fetch_array($check); $email = stripslashes($row['email']); }else{ header('Location: ../login/login.php?page=1'); } ?>
  4. this is my code <?php require ("s_check_login.php"); include ('database.php'); if(isset($_POST['csv_btn'])){ $str = $_POST['csv']; $date = mysql_real_escape_string($_POST['date']); $gal = mysql_real_escape_string($_POST['gal']); $op = mysql_real_escape_string($_POST['op']); $parts = explode( "\n", $str ); $team = array(); foreach( $parts as $part ) $team[] = str_getcsv($part); unset($parts); $tcount = count($team); for($x=0; $x<$tcount; $x++){ $p = $team[$x]; $sql = "INSERT INTO gbsa_stats (id, Player, Day_Played, Opponent, Gallery_no, Goals, Assists, Shots, On_Goal, Off_Post, Offsides, Saves, Fouls, Shots_Corner, Goals_Corner, Yellow, Red) VALUES ('NULL','$p[1]','$date','$op','$gal','$p[2]','$p[3]','$p[4]','$p[5]','$p[6]','$p[7]','$p[8]','$p[9]','$p[10]','$p[11]','$p[12]','$p[13]')"or die ('Error Updateing Database ' .mysql_error()); if (!mysql_query($sql)){ die('Error : ' .mysql_error()); } } } ?> <!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=utf-8" /> <title></title> </head> <body> <form id="form1" name="form1" method="post" action=""> <h1>csv data:</h1> <textarea name="csv" cols="100" rows="25" id="csv"></textarea> <br /> <h1>Date:</h1> <input type="text" name="date" id="date" /> <br /> <h1>Opponent:</h1> <input type="text" name="op" id="op" /> <br /> <h1>Gallery Number:</h1> <input type="text" name="gal" id="gal" /> <br /> <h1> </h1> <input type="submit" name="csv_btn" id="csv_btn" value="Submit" /> </form> </body> </html> when i run it on my local machine it works with no problem but when i upload it to my server and try to run it i get this error Fatal error: Call to undefined function str_getcsv() in /html/admin/stats.php on line 14
  5. cmb

    Update query

    i used an update replace query
  6. cmb

    Update query

    In my database one of the columns is called keywords. In this column is all the keywords that were on a picture that was uploaded, and the keywords are separated by a commas. By mistake all the photos that were uploaded had the keyword Fire Storm on them. What i would like to do is delete Fire Storm from all the records but still leave the rest of the keywords without having to do it manually
  7. The first part of my code groups all the records in my database by the year and then by the session and then puts it all into an array <?php $n_query = "SELECT COUNT(id) AS 'count', Year_Played, Sessions FROM pinkpanther_games GROUP BY Year_Played, Sessions ORDER BY Year_Played DESC, Sessions ASC"; $n_results = mysql_query($n_query) or die("Query failed ($n_query) - " . mysql_error()); $syp_row = mysql_fetch_array($n_results); mysql_data_seek($n_results,0); $years = array(); $y_s = array(); while ($n_row = mysql_fetch_array($n_results)){ array_push($y_s,$n_row['count'],$n_row['Year_Played'],$n_row['Sessions']); array_push($years,$y_s); unset($y_s); $y_s = array(); } ?> The array looks like this Array ( [0] => Array ( [0] => 9 //The number of records [1] => 20112012 //The year [2] => 1 //The session ) [1] => Array ( [0] => 1 [1] => 20112012 [2] => 2 ) [2] => Array ( [0] => 11 [1] => 20102011 [2] => 1 ) [3] => Array ( [0] => 10 [1] => 20102011 [2] => 2 ) ) then i count the number of values in the array so i can set up my while loop and the reason that my second query is in the while loop is because now what i want to do is show all the records for each year and session. So i just change the variables in the query this is the rest of the code <?php $s = $years[$x][1]; $yp = $years[$x][2]; echo $s . "||" . $yp ."<br />"; $query = "SELECT * FROM pinkpanther_games WHERE Year_Played = '$yp' AND Sessions = '$s' ORDER BY id ASC "; $results = mysql_query($query) or die ("Query failed ($query) -" . mysql_error()); $lrow = mysql_fetch_assoc($results); $date1 = substr($lrow['Year_Played'], 0,4); $date2 = substr($lrow['Year_Played'],4,; echo "<fieldset><legend>" . $date1 . "-" . $date2 . " Session " . $lrow['Sessions'] ."</legend>"; mysql_data_seek($results,0); while ($row = mysql_fetch_assoc($results)){ $g = $row['Gallery_no']; echo "<a href='galleries.php?g=$g'>" . $row['Opponent'] . "</a><br />"; } echo "</fieldset><br />"; $x++; } ?> So any help on a more correct way to do this would be great
  8. this is my query that returns no results <?php $query = "SELECT * FROM pinkpanther_games WHERE Year_Played = '$yp' AND Sessions = '$s' ORDER BY id ASC "; ?> i checked to make shore $yp and $s were actually set, which they were, then i replaced them with actual values like this <?php $query = "SELECT * FROM pinkpanther_games WHERE Year_Played = '20112012' AND Sessions = '2' ORDER BY id ASC "; ?> and it returned the correct number of records idk what the problem is this is all the code for the page if that matters <?php $n_query = "SELECT COUNT(id) AS 'count', Year_Played, Sessions FROM pinkpanther_games GROUP BY Year_Played, Sessions ORDER BY Year_Played DESC, Sessions ASC"; $n_results = mysql_query($n_query) or die("Query failed ($n_query) - " . mysql_error()); $syp_row = mysql_fetch_array($n_results); mysql_data_seek($n_results,0); $years = array(); $y_s = array(); while ($n_row = mysql_fetch_array($n_results)){ array_push($y_s,$n_row['count'],$n_row['Year_Played'],$n_row['Sessions']); array_push($years,$y_s); unset($y_s); $y_s = array(); } $count = count($years); $x = 0; while ($x < $count){ $s = $years[$x][1]; $yp = $years[$x][2]; echo $s . "||" . $yp ."<br />"; $query = "SELECT * FROM pinkpanther_games WHERE Year_Played = '$yp' AND Sessions = '$s' ORDER BY id ASC "; $results = mysql_query($query) or die ("Query failed ($query) -" . mysql_error()); $lrow = mysql_fetch_assoc($results); $date1 = substr($lrow['Year_Played'], 0,4); $date2 = substr($lrow['Year_Played'],4,; echo "<fieldset><legend>" . $date1 . "-" . $date2 . " Session " . $lrow['Sessions'] ."</legend>"; mysql_data_seek($results,0); while ($row = mysql_fetch_assoc($results)){ $g = $row['Gallery_no']; echo "<a href='galleries.php?g=$g'>" . $row['Opponent'] . "</a><br />"; } echo "</fieldset><br />"; $x++; } ?>
  9. this form i have takes some csv data and turns it into an array. For some reason the script inserts a blank key into the array and idk why. this is my script code: <?php if(isset($_POST['csv_btn'])){ $csv = $_POST['csv']; //turns csv into an array with each spot in the array a player and all data seperated by a comma $csv_mod = explode("Home,",$csv); $y = count($csv_mod) - 1; $x = 0; $team = array(); while ($x <= $y){ //takes the array from the csv explode and explodes each player and their data $tx = $csv_mod[$x]; $ex_tx = explode(",",$tx); $ex_tx_c = count($ex_tx); $z = 1; //is the players name $person = $ex_tx[0]; $person2 = $ex_tx[0]; //turn the player into an array $person = array(); //puts the players data into their array while ($z < $ex_tx_c){ array_push($person, $ex_tx[$z]); $z++; } //adds the player to the team array with their name being the index $team[$person2] = $person; $x++; } print_r($team); } ?> this is what i put into the script(exactly like this): Home,AJ,2,1,2,2,0,0,0,0,0,0,0,0 Home,Conner,0,0,2,2,0,0,0,0,0,0,0,0 Home,Joe,0,0,1,1,0,0,0,1,0,0,0,0 Home,Tyler,0,0,0,0,0,0,0,0,0,0,0,0 this is what it outputs: Array ( [] => Array ( ) [AJ] => Array ( [0] => 2 [1] => 1 [2] => 2 [3] => 2 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 ) [Conner] => Array ( [0] => 0 [1] => 0 [2] => 2 [3] => 2 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 ) [Joe] => Array ( [0] => 0 [1] => 0 [2] => 1 [3] => 1 [4] => 0 [5] => 0 [6] => 0 [7] => 1 [8] => 0 [9] => 0 [10] => 0 [11] => 0 ) [Tyler] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 ) )
  10. I am completely new to JavaScript I have no idea how to do anything with it . I was wondering if anybody new a good way, or site, or program/class that would teach me how to program JavaScript
  11. WOW im stupid i forgot that this was also in an if statement and i only corrected the one part instead of both thanks for the help
  12. this is what its out putting <a href='tag.php?tag=Ryan_S'Ryan_S>Ryan_S</a></div></div></li><li> also i don't think this is important but i am using this in the gallerific jquery plugin
  13. its not replacing the _ with a space
  14. all i want is for when their is a _ to be replaced with a space so i tried these and neither worked <?php $pmod = str_replace("_"," ",$p); $pmod = preg_replace("_"," ",$p); ?> so i was wondering if because this was in a while statement, is this the reason its not working, and if so how should i fix it (this is the while) <?php while ($z <= $w){ $p = $multi[$z]; $pmod = str_replace("_"," ",$p); echo "<a href='tag.php?tag=$p'" . $p . ">" . $pmod . "</a> "; $z++; } ?>
  15. i just broke up the echo so i could write this code here like this <?php while ($y <= $x){ $name = $tags[ $y . '.jpg']; $multi = explode(',',$name); $count = count($multi); echo "<li> <a class='thumb' href='../images/Sections/pinkpanthers/" . $year . "/" . $sessions . "/" . $day . "/" . $y . ".jpg' title=''><img src='../images/Sections/pinkpanthers/" . $year . "/" . $sessions . "/" . $day . "/thumbs/" . $y . ".jpg ' /></a><div class='caption'><div class='download'><a href='../images/Sections/pinkpanthers/" . $year . "/" . $sessions . "/" . $day . "/big/" . $y . ".jpg ' target='_blank' />Download</a></div><div class='image-desc'>"; if ($count == 1){ echo "<a href='tag.php?tag=$name'" . $name . ">" . $name . "</a>"; } if ($count > 1){ $z = 0; $w = $count - 1; while ($z <= $w){ $p = $multi[$z]; echo "<a href='tag.php?tag=$p'" . $p . ">" . $p . "</a> "; $z++; } } echo "</div></div></li>"; $y ++ ; } ?>
  16. cmb

    array spliting

    How can I spilt this part of the array [15.jpg] => Callum,Grant So it looks like this or means the same thing [15.jpg] => Callum [15.jpg] => Grant
  17. how would i do this while part <?php $z = 0; $w = $count - 1; while ($z <= $w){ $p = $multi[$z]; $keys = "<a href='tag.php?tag=$p'" . $p . ">" . $p . "</a>"; $z++; } ?> because how i have it now it only shows 1 of the keywords not all of them
  18. how can i put an if statement inside an echo this is what i want to do <?php echo "<li> <a class='thumb' href='../images/Sections/pinkpanthers/" . $year . "/" . $sessions . "/" . $day . "/" . $y . ".jpg' title=''> <img src='../images/Sections/pinkpanthers/" . $year . "/" . $sessions . "/" . $day . "/thumbs/" . $y . ".jpg ' /></a><div class='caption'> <div class='download'><a href='../images/Sections/pinkpanthers/" . $year . "/" . $sessions . "/" . $day . "/big/" . $y . ".jpg ' target='_blank' />Download</a> </div><div class='image-desc'>" . if ($count == 1){echo "<a href='tag.php?tag=$name'" . $name . ">" . $name . "</a>";}if ($count > 1){$z = 0;$w = $count - 1;while ($z <= $w){$p = $multi[$z];echo "<a href='tag.php?tag=$p'" . $p . ">" . $p . "</a>";$z++;}} . "</div></div></li>"; ?> all the code works wright up until i added the if statements in the last little bit
  19. right now my array is set up so the title of the picture (which is a number) is the key and the keyword or words associated with that picture are the values separated by commas: Array( [1.jpg] => Tyler [10.jpg] => Callum [11.jpg] => Callum [12.jpg] => Adam [13.jpg] => Justin [14.jpg] => Shane [15.jpg] => Callum,Grant [16.jpg] => Justin [17.jpg] => Justin [18.jpg] => Austin [19.jpg] => Jarod [2.jpg] => Tyler [20.jpg] => Austin [21.jpg] => Tyler [22.jpg] => Justin [23.jpg] => Tyler [24.jpg] => Jarod [3.jpg] => Callum [4.jpg] => Shane,Callum [5.jpg] => Adin [6.jpg] => Justin [7.jpg] => Callum [8.jpg] => Adam [9.jpg] => Callum [25.jpg] => Jarod ) im using the galleriffic jquery photo album and in the description area for the picture it shows the keywords in a hyperlink to another page were it shows all the pictures with that keyword but what i want is for when their are multiple keywords i want them to show up as separate hyperlinks
  20. I'll be creating a script that will get the keywords from uploaded pictures and what i cant figure out is how to actually get only the keywords from the iptc data this is the code i have for getting the iptc data right now: <?php $size = getimagesize('images/Sections/pinkpanthers/20102011/Session1/1-15-11/1.jpg', $info); if(isset($info['APP13'])) { $iptc = iptcparse($info['APP13']); var_dump($iptc); ?> } and this outputs array(4) { ["1#090"]=> array(1) { [0]=> string(3) "%G" } ["2#000"]=> array(1) { [0]=> string(2) "" } ["2#025"]=> array(1) { [0]=> string(5) "Tyler" } ["2#080"]=> array(1) { [0]=> string(15) "Christian" } } all i want from the above string is the Tyler
  21. cmb

    Menu Bar

    this is the script it also uses jquery /*! * SmoothMenu addon for jQuery UI * https://github.com/madguy/jQuery.ui.smoothMenu * Copyright 2011, madguy * License MIT-style License. * http://www.opensource.org/licenses/mit-license.php * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * * Inspired by MenuMatic * http://greengeckodesign.com/menumatic */ (function ($, undefined) { var isNumber = function (value) { return typeof value === "number" && isFinite(value); }; $.widget('ui.smoothMenu', { widgetEventPrefix: 'smoothMenu', _wrapToWidgetEvent: function (type) { return type + '.' + this.widgetEventPrefix; }, options: { childTag: 'li', delay: 1000, direction: 'horizontal', dockId: 'ui_smooth_menu_container', duration: 200, easing: 'swing', icon: true, opacity: 0.95, parentTag: 'ul', zIndex: 1 }, _create: function () { var self = this; var options = self.options; var $elm = self.element; var $rootContainer = self._getOrCreateContainer(); var $parent = $elm.children(options.parentTag + ':first'); options.parentNode = $parent; // 再帰的に子要素を探索して、子要素から先にコンテナに入れます。 var childOption = $.extend({}, options, { direction: 'vertical', zIndex: options.zIndex + 1 }); // 子要素まですべて適用してからbindしないと先にイベントが動いてしまうため、あとからイベントを付加します。 var $childNodes = $parent.children(options.childTag).smoothMenu(childOption).bind({ smoothmenuonhide: function (event, $elm) { self.hide(); } }); options.childNodes = $childNodes; options.defaultCss = { marginLeft: $parent.css('marginLeft'), marginTop: $parent.css('marginTop'), opacity: $parent.css('opacity'), visibility: $parent.css('visibility') }; $elm.addClass('ui-smoothMenu-item ui-widget ui-corner-all ui-state-default').bind(self._wrapToWidgetEvent('mouseenter'), function (event) { if (options.disabled === false) { $elm.addClass('ui-state-hover'); } self._mouseEnter(event); $(this).smoothMenu('show'); }).bind(self._wrapToWidgetEvent('mouseleave'), function (event) { $elm.removeClass('ui-state-hover'); self._mouseLeave(event); setTimeout(function () { $elm.smoothMenu('hide'); }, options.delay); }); if ($parent.length > 0) { var $container = $('<div />').css({ display: 'none', overflow: 'hidden', position: 'absolute', zIndex: options.zIndex }).bind(self._wrapToWidgetEvent('mouseenter'), function (event) { self._mouseEnter(event); }).bind(self._wrapToWidgetEvent('mouseleave'), function (event) { self._mouseLeave(event); }).append($parent).appendTo($rootContainer); options.container = $container; if (options.icon) { var iconClass = options.direction === 'horizontal' ? 'ui-icon-triangle-1-s' : 'ui-icon-triangle-1-e'; var $icon = $('<span class="ui-icon" />').addClass(iconClass); $elm.append($icon); } } else { options.container = $(); } $elm.smoothMenu('hide', 0); }, destroy: function () { var self = this; var options = self.options; var $elm = self.element; if (options.disabled) { self.enable(); } $elm.removeClass('ui-smoothMenu-item ui-widget ui-corner-all ui-state-default').unbind('.' + self.widgetEventPrefix); $elm.find('.ui-icon').remove(); var $container = options.container; // 子要素を再帰的に復元します。 options.childNodes.smoothMenu('destroy'); var $parent = $container.children(options.parentTag); $parent.stop(true, true).css(options.defaultCss); $elm.append($parent); $container.remove(); self._removeContainerIfEmpty(); return self; }, enable: function () { var $childNodes = this.options.childNodes; $childNodes.smoothMenu('enable'); $.Widget.prototype.enable.call(this); }, disable: function () { var $childNodes = this.options.childNodes; $childNodes.smoothMenu('disable'); this.hide(); $.Widget.prototype.disable.call(this); }, rootContainer: function () { return this._getOrCreateContainer(); }, content: function () { return this.options.parentNode; }, show: function (duration) { var self = this; var options = this.options; var $elm = self.element; var $container = options.container; var $parent = $container.children(options.parentTag); duration = isNumber(duration) ? duration : options.duration; if (options.disabled) { return; } $elm.siblings().smoothMenu('hide', 100); if (options.visible) { return; } var isContinue = self._trigger('beforeShow', null, $elm); if (isContinue === false) { return; } var offset = $elm.offset(); var extendWidth = options.direction !== 'horizontal' ? $elm.outerWidth(true) : 0; var extendHeight = (function () { if (options.direction === 'horizontal') { return $elm.outerHeight(true); } else { var containerHeight = $container.outerHeight(true) || 0; var documentHeight = $(document).height(); return Math.min(documentHeight - (offset.top + containerHeight), 0); } })(); // 先にコンテナは表示状態にする必要があります。 $container.show(); // Marginはプラグイン側で移動させるので取得しません。 var height = $parent.outerHeight() || 0; var width = $parent.outerWidth() || 0; $container.css({ left: String(offset.left + extendWidth) + 'px', height: String(height) + 'px', top: String(offset.top + extendHeight) + 'px', width: String(width) + 'px' }); $parent.stop(true).animate({ marginLeft: '0px', marginTop: '0px', opacity: options.opacity }, { duration: duration, easing: options.easing }); options.visible = true; self._trigger('onShow', null, $elm); }, hide: function (duration) { var self = this; var options = self.options; var $elm = self.element; var $container = options.container; var $parent = $container.children(options.parentTag); duration = isNumber(duration) ? duration : options.duration; if (options.disabled) { return; } if (options.visible === false) { return; } if (self.isMouseOver(true)) { return; } var isContinue = self._trigger('beforeHide', null, $elm); if (isContinue === false) { return; } var marginLeft = options.direction !== 'horizontal' ? -1 * $container.outerWidth() : 0; var marginTop = options.direction === 'horizontal' ? -1 * $container.outerHeight() : 0; $parent.stop(true).animate({ marginLeft: String(marginLeft) + 'px', marginTop: String(marginTop) + 'px', opacity: 0 }, { duration: duration, easing: options.easing, complete: function () { $container.hide(); } }); self._trigger('onHide', null, $elm); options.visible = false; // 親が閉じられたら子要素も同時に閉じます。 options.childNodes.smoothMenu('hide'); }, isMouseOver: function (deepSearch) { var isMouseOver = this.options.isMouseOver; if (deepSearch) { var hasMouseOverChild = this._hasMouseOverChild(); return isMouseOver || hasMouseOverChild; } else { return isMouseOver; } }, _hasMouseOverChild: function () { var $childNodes = this.options.childNodes; var hasMouseOverChild = $childNodes.filter(function () { return $(this).smoothMenu('isMouseOver', true); }).length > 0; return hasMouseOverChild; }, _mouseEnter: function (event) { this.options.isMouseOver = true; }, _mouseLeave: function (event) { this.options.isMouseOver = false; }, _getOrCreateContainer: function () { var id = this.options.dockId; var $container = $('#' + id); if ($container.length === 0) { $container = $('<div />', { id: id, 'class': 'ui-widget ui-smoothMenu' }).appendTo(document.body); } return $container; }, _removeContainerIfEmpty: function () { var $container = this._getOrCreateContainer(); if ($container.is(':empty')) { $container.remove(); } } }); $.extend($.ui.smoothMenu, { version: '0.2.4' }); })(jQuery);
  22. cmb

    Menu Bar

    im using a script i found online to generate a menu bar and it works great except for every time you navigate to a different page it shows the menu as the unordered list before anything else loads and i was wondering how to stop this from happening
  23. added this <?php mysql_data_seek($results,0); ?> befor this <?php while ($row = mysql_fetch_assoc($results)){ $opp = $row['Opponent']; $score = $row['Score']; $gal = $row['Gal']; $wlt = $row['Record']; //styles games acording to if win lose or tie if ($wlt == 'Win'){ echo "<tr><td class='win'>"; echo "<a href='galleries.php?g=$gal'" . $gal . " >" . $opp . "</a>"; echo "</td><td class='win'>"; echo $score . ""; echo "</td></tr>"; } if ($wlt == 'Loss'){ echo "<tr><td class='loss'>"; echo "<a href='galleries.php?g=$gal'" . $gal . " >" . $opp . "</a>"; echo "</td><td class='loss'>"; echo $score . ""; echo "</td></tr>"; } if ($wlt == 'Tie'){ echo "<tr><td class='tie'>"; echo "<a href='galleries.php?g=$gal'" . $gal . " >" . $opp . "</a>"; echo "</td><td class='tie'>"; echo $score . ""; echo "</td></tr>"; } } ?> and it all works now
  24. so how can i display that twice then
  25. it displays the correct record just not the first value of the query search
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.