PHP - Moved: Php Code Neede To Make The Background Page Grey While A Popup Window Is Active
This topic has been moved to JavaScript Help.
http://www.phpfreaks.com/forums/index.php?topic=317523.0 Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317921.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347166.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=329157.0 Hi, Sorry if this is in the wrong place. I really just need a search term to use for what i'm trying to do. I would like my buttons to appear pressed on each page. For example if you are on the home page the home button will appear pressed. If you are on the screenshots page the screenshots button will appear pressed. Pretty much i want my nav bar to display what page is being viewed. I'm using SMF forums and i've created an extension of my forum that i'm using on the root of my site. As far as i can tell i have the correct code added to the forum that should highlight the home button while on the home page. The part i'm missing is the code to add onto the home page. This is the code I have on the button. $buttons = array( 'overview' => array( 'title' => $txt['overview'], 'href' => 'http://www.wararmada.com', 'show' => true, 'sub_buttons' => array( 'alliance' => array( 'title' => $txt['alliance'], 'href' => $scripturl . '?action=overview;area=alliance', 'show' => true, ), This is the code i have in the language file. $txt['overview'] = 'overview'; I'm not sure what this is called. I don't know anything about php but so far i've been able to get by just using google but I don't really know how to search for this. Thanks for all the help! This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=333559.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=322542.0 I'm wondering what makes a pop-up login window run differently than inside a webpage. I can't seem to get my login system to bring the user back to the page (brings them to a page can't be found) when clicking a form submit button when it is included in the webpage. But if your in the popup page that I'm trying to include, it works no problem so I was wondering if it changes anything. Or if there is some sort of work around (such as embedding a popup window into the webpage). Thanks a lot! This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=354424.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=354321.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=349726.0 I would like to know how to make my links show that it's active. For example if I click on a link that says overview then that link has to be highlighted. This is the code that I have: Code: [Select] <?php if (isset($this->_params['submenus']) && is_array($this->_params['submenus'])){ foreach ($this->_params['submenus'] as $submenu){ ?> <li class="active"><a href="<?php echo $this->get_uri("/{$submenu['controller']}/{$submenu['action']}") ?>" onclick="javascript:return setSubMenu(<?php echo $submenu['id'] ?>);"><?php echo strtoupper($submenu['name'])?></a></li> <?php } } ?> Unfortunately with this code all the links are selected as active. Hello I need help with making our dropdown links stay visible when active. Site: London tshirt .com Code: [Select] <dl id="nav"> <dt class="nav"><b>London Tshirts</b></dt> <dd> <ul> <li><a href="/Unisex">Unisex</a></li> <li><a href="/Slimfit">Slimfit</a></li> <li><a href="/Kids">Kids</a></li> </ul> </dd> <dt class="nav"><b>Alternative Tshirts</b></dt> <dd> <ul class="nav"> <li><a href="/England">England</a></li> <li><a href="/Humour">Humour</a></li> <li><a href="/Popular">Popular</a></li> </ul> </dd> <dt class="nav"><b>Magnets</b></dt> <dd> <ul class="nav"> <li><a href="/magnets-ceramic">Ceramic</a></li> <li><a href="/magnets-metal">Metal</a></li> <li><a href="/magents-plastic">Plastic</a></li> </ul> </dd> <dt class="nav"><b>Keyrings</b></dt> <dd> <ul class="nav"> <li class="current"><a href="/keyrings-ceramic">Ceramic</a></li> <li class="current"><a href="/keyrings-metal">Metal</a></li> <li><a href="/keyrings-plastic">Plastic</a></li> </ul> </dd> <dt class="nav"><b>Other gifts</b></dt> <dd> <ul class="nav"> <li><a href="/Hats">Hats</a></li> <li><a href="/Models">Models</a></li> <li><a href="/Bags">Bags</a></li> </ul> </dd> </dl> Thanks P.S. I typed my question, then went to verification, but could not read the letters so requested a new image, this refreshed the page and I lost my message?? Trying to get popup window to work in php. Keep getting template parse errors. Here's the code I've been using in HTML: Code: [Select] echo ' <a onClick="window.open('annexplayerpop.shtm','popup','height=275,width=425,top=130,left=280,scrollbars=no')" target="popup"><img src="popupbutton-blue-bg.png" title="Popup MP3 Player" border="0" height="45" width="58"></a> '; I have got a code working to generate a menu from a mysql table, but I wan't to know if it is possible to have the background colour change to a third option when active. I have 1 background colour for 'off', one for mouseover, but can't figure out how to tell it what they current page is so that it will use a different css class value, as the page obviously reloads after the link is clicked. Is it possible (hope my explanation makes some sence!) My code: At the moment mainNav a: and mainNav a:hover work ok but what I want is a mainNav a:active to stay on after the page has loaded Code: [Select] <?php //function to nest the menu tree function nest_child(&$nodes, $current) { if (!isset($nodes) || count($nodes) < 1) { return; } foreach ($nodes as $id => $item) { if ($current['parentdocid'] == $id) { if (!isset($item['children'])) { $item['children'] = array(); } array_push($item['children'], $current); $nodes[$id] = $item; } else { nest_child($item['children'], $current); } } } //functions to display the tree and expand as appropriate function menu_display($nodes, $display_id) { if (!isset($display_id) || ($display_id == '')) { $display_id = 1; } $result = node_display( array( 'doc_id' => 1, 'children' => $nodes ), $display_id ); return $result[1]; } function node_display($node, $display_id) { global $ROOT; $found = false; $text = ''; if (isset($node[children])) { foreach ($node[children] as $id => $child) { $text .= "<li class='mainNav'><a href='$ROOT/index.php?doc_id=$child[doc_id]'>$child[doc_name]</a>"; $result = node_display($child, $display_id); if ($result[0]) { $found = true; $text .= "<ol>$result[1]</ol>"; } if ($child[doc_id] == $display_id) { $found = true; if (isset($child[children])) { $text .= "<ol>"; foreach ($child[children] as $id => $grandchild) { $text .= "<li class='mainNav'><a href='$ROOT/index.php?doc_id=$grandchild[doc_id]'>$grandchild[doc_name]</a>"; } $text .= "</ol>"; } } $text .= "</li>"; } } if ((!$found) && ($display_id != 1)) { $text = ''; } return array($found, $text); } ?> <ul class="menu"> <?php //retrieve all the menu elements $result = mysql_query('SELECT * FROM docs ORDER BY doc_order ASC'); $menu = array(); while ($row = mysql_fetch_assoc($result)) { $menu[$row['doc_id']] = $row; } //nest the elements foreach ($menu as $id => $item) { if ($item['parentdocid'] != 1) { nest_child($menu, $item); unset($menu[$id]); } } //display the tree print menu_display($menu, $doc_id); ?> </ul> Hi, On a website, there are products nicely listed with name, description, product code, price and a thumbnail etc. Now, if you click on a picture thumbnail, a new page called prodwin.php in a new window opens with the product code and for some reason, there is a "no picture available" alt image for every product. The line of code in it: <td colspan="2"><?php if(file_exists("../pics_p/".$HTTP_GET_VARS["PCode"].".jpg")){?><img src="../pics_p/<?php echo $HTTP_GET_VARS["PCode"] ?>.jpg" alt="Product Picture" galleryimg="no"><?php }else{?><img src="../imgz/nopic.jpg" alt="No Picture Available" width="306" height="200" galleryimg="no"><?php }?></td> The URL of that page looks like this: http://www.lock-tech.co.uk/scrptz/prodwin.php?SCode=CHL8K119S&PCode=CHL8K119S&PDescription=+DOOR%20PATIO%20LOCK&KEY%20SATIN&thePrice=%A328.52%20/%20EA On the other hand, when you click on the product name, it loads a different page called g_browse.php and the product image is nicely there. The line of code in it: <td height="366" colspan="2" valign="top"><?php if(file_exists("pics_p/".$array[$getVars["index"]]["PCode"].".jpg")){?><img src="pics_p/<?php echo $array[$getVars["index"]]["PCode"] ?>.jpg" alt="Product Picture" galleryimg="no"><?php }else{?><img src="imgz/nopic.jpg" alt="No Picture Available" width="306" height="200" galleryimg="no"><?php }?></td> Code: [Select] $HTTP_GET_VARS["PCode"].".jpg" - Product code + .jpg will give the image name in pics_p folder. a JavaScript block which might also be relavant: Code: [Select] function prodWindow(SCode, PCode, PDescription, thePrice) { var xPos=(screen.availWidth/2)-490; var yPos=(screen.availHeight/2)-116; var s=",top="+yPos+",left="+xPos; var win=open("scrptz/prodwin.php?SCode="+SCode+"&PCode="+PCode+"&PDescription="+PDescription+"&thePrice="+thePrice,'product', "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,scrollbars=no,height=414,width=316"+s); win.focus(); } Hope someone spots the problem. Regards, laanes I have a login modal window which is user for entering the login and password, and check it with the database.If the login and password is not there i nthe database the message shuld be displayed in the popup window itself. But in my case the popup window disapperas if the login details are wrong. how shuld i code for this. My code is pasted below. <div id="cover"></div> <div id="dialog"> <form action='' method='post' name='onlinepay'> <table width="388" border=1><tr><td colspan="4" align="right"></td><td align="right"><a href="index.php" onclick="closePopUp('dialog');"><img src='images/close.jpg' align="right" /></a></td></tr> <tr><td width="11" ></td> <td width="90">Username </td> <td width="57">:</td> <td width="147"><input type='text' name='username' id='username' /></td><td width="59"></td> </tr> <tr><td></td><td>Password</td><td>:</td><td><input type='text' name='password' id='password' /></td><td><input type='submit' name='submit' id='submit' value="Login" /></td></tr><tr><td colspan='5'><?php //connection statements goes here if(isset($_POST['submit'])){ $username=$_POST['username']; $password=$_POST['password']; $sql="select username,password from register where username='$username' and password='$password'"; $result=mysql_query($sql); $row=mysql_fetch_row($result); $row1=mysql_num_rows($result); if(($row['0']==$username) && ($row['1']==$password)){ header ('Location:themes/index.php'); } else{ echo "Username and password doesnot match"; } } ?> </td></tr> <tr><td colspan="5"><hr color="#999999" /></td></tr><tr><td></td><td colspan='2'><a href="javascript:void window.open('themes/forgotpassword.php?fullview=Y','','height=350,width=525,resizable=yes,scrollbars=yes')">Forgot password? </a> </td> <td><a href='register.php'>New User</a></td> <td align='center'> </td> </tr> </table> </form> I need help with my webpage here, how do you get so if you are at http://www.blabla.com/account.php and then click on a photo, it will go to www.blabla.com/photo.php?id=1 but still be at account.php? Just like facebook shows their photos. I dont know how to think nor to get it work. Would appreciate some help! ThNXX 1n 4dv4nc3 // Machram! Scenario. I have a simple form and on the same page a link to open a popup window. The client completes the form then click the upload link. In the popup window the client uploads a file. Problem On closing the popup window the main page is refreshed (to indicate the upload was successful) As the form was not initially submitted - All Form Data is then Lost Question Is there a way of submitting the form and opening a popup window at the same time (to preserve the data entered by the client) or is there another fix for this problem ? Any help is greatly appreciated. Cheers Hey I 'm new to this but i got this code the links to images in my database and display them to the user but i want the images to pop-up out of the screen like this website : http://pinterest.com/ here when the small images are clicked displaying all the comments from users under it here is the code: and thanks <?php include('models/user.php'); ob_start(); if(isset($_GET['cat'])){ $objCat = new dbConfig(); $sqlCat = $objCat->selectQuery("select * from categories WHERE cat_id = ".$_GET['cat']); $rowCat = mysql_fetch_array($sqlCat); $title = "Blabben - ".$rowCat['cat_name']; } elseif(isset($_GET['category'])){ $objCat = new dbConfig(); $sqlCat = $objCat->selectQuery("select * from categories WHERE cat_id = ".$_GET['category']); $rowCat = mysql_fetch_array($sqlCat); $title = "Blabben - ".$rowCat['cat_name']; } else { $title = "Blabben"; } ?> <?php define('INCLUDE_CHECK',1); require "timeline/functions.php"; require "timeline/connect.php"; // remove blabs older than 1 hour to prevent spam //mysql_query("DELETE FROM blabs WHERE blab_id>1 AND blab_date<SUBTIME(NOW(),'0 1:0:0')"); //fetch the timeline if(isset($_GET['top'])&&!isset($_GET['cat'])){ $q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50"); }elseif(isset($_GET['top'])&&isset($_GET['cat'])){ $q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.cat_id = ".$_GET['cat'].") AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50"); }elseif(!isset($_GET['top'])&&isset($_GET['cat'])){ $q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.cat_id = ".$_GET['cat'].") AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50"); } elseif(isset($_GET['points'])){ $q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND (follow.follower = ".$uinfo['user_id'].") AND blabs.blab!='0' ORDER BY users.points DESC LIMIT 50"); } //elseif(isset($_GET['cat'])){ //$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND blabs.blab!='0' AND (follow.follower = ".$uinfo['user_id'].") AND blabs.cat_id = ".$_GET['cat']." ORDER BY blabs.blab_id DESC LIMIT 50"); //}elseif(isset($_GET['category'])){ //$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND blabs.blab!='0' AND (follow.follower = ".$uinfo['user_id'].") AND blabs.cat_id = ".$_GET['category']." ORDER BY blabs.blab_id DESC LIMIT 50"); //} else{ $q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND (follow.follower = ".$uinfo['user_id'].") AND blabs.blab!='0' ORDER BY blabs.blab_id DESC LIMIT 50"); } $timeline=''; //$row1=mysql_fetch_assoc($q); //$bd = $row1['blab_date']; //$blab_date = relativeTime($bd,$precision=2); while($row=mysql_fetch_assoc($q)) { $timeline.=formatTweet($row['name'],$row['uname'],$row['state'],$row['picture'],$row['blab'],$row['blab_date'],$row['user_id'],$row['blab_id']); } // fetch the no blab $noblab = ''; //if(isset($_GET['cat'])){ //$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs WHERE blab!=0 AND cat_id=".$_GET['cat'])); //} //elseif(isset($_GET['category'])){ //$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs WHERE blab!=0 AND cat_id=".$_GET['category'])); //}else{ //$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs where `blab`!='0'")); //} //if($blabcount<=0){ $noblab = "<div style='padding:20px 15px; text-align:center;' id='noblab'>No Blab Posted</div>"; } ?> <script> $(document).ready(function(){ $('#noblab').hide(); }); </script> <?php if(isset($_GET['verified'])&& $_GET['verified']=='1'){ ?> <script type="text/javascript"> showNotification({ message: "Congratulations! You have got 250 points for verifying your account", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['verified'])&& $_GET['verified']=='11'){ ?> <script type="text/javascript"> showNotification({ message: "Your account is already verified.", type: "error", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['blab'])&& $_GET['blab']=='added'){ ?> <script type="text/javascript"> showNotification({ message: "Blab has been added successfully.", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if((isset($_GET['welcome'])&& $_GET['welcome']=='1')||($uinfo['verified']=='0')){ ?> <script type="text/javascript"> showNotification({ message: "<span style='color:#000;'><strong>Confirm your email address to access all of Blabben's features</strong>. A confirmation message was sent to <strong><?php echo $uinfo['email']; ?></strong><br /><span style='color:#000;'><a style='color:blue; text-decoration:underline; font-weight:normal;' href='models/resend.php'>Resend Confirmation Email</a> | <a style='color:blue; text-decoration:underline; font-weight:normal;' href='account'>Update Email Address</a></span></span>", type: "success", autoClose: false, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['blab'])&& $_GET['blab']=='deleted'){ ?> <script type="text/javascript"> showNotification({ message: "Blab has been deleted successfully.", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['b'])&& $_GET['b']=='err'){ ?> <script type="text/javascript"> showNotification({ message: "Sorry! You don't have enough points.", type: "error", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['resent'])&& $_GET['resent']=='1'){ ?> <script type="text/javascript"> showNotification({ message: "Confirmation email has been resent on your Email.", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <SCRIPT LANGUAGE="JavaScript"> <!-- Limit the number of characters per textarea --> <!-- Begin function textCounter(field,cntfield,maxlimit) { if (field.value.length > maxlimit) // if too long...trim it! field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter else cntfield.value = maxlimit - field.value.length; } // End --> </script> <!--tabs--> <div id="tabs-con"> <div id="tabs1"> <!--id="nation"--> <div class="tab roundT"><a href="http://www.blabben.com">Blabbing</a><!--<span></span>--> </div> <div class="tab roundT"><a href="upload-picture.php">Upload Picture</a></div> <div class="tab roundT"><a <?php if(isset($_GET['cat'])){ ?>href="home?category=<?php echo $_GET['cat']; ?>" <?php } elseif(isset($_GET['category'])){ ?>href="home?category=<?php echo $_GET['category']; ?>"<?php }elseif(isset($_GET['tp'])){ ?>href="home?alltp"<?php }else{ ?>href="home?all"<?php } ?>> <?php if(isset($_GET['cat'])){ ?><?php echo $rowCat['cat_name']; ?> All Pictures<?php } elseif(isset($_GET['category'])){ ?><strong><?php echo $rowCat['cat_name']; ?> All Pictures</strong><?php } elseif(isset($_GET['alltp'])){ ?><strong>All Recent Pictures</strong><?php } elseif(isset($_GET['all'])){ ?><strong>All Recent Pictures</strong><?php }else{ ?>All Recent Pictures<?php } ?></a></div> <div class="tab roundT"><a <?php if(isset($_GET['cat'])){ ?> href="home?tp&cat=<?php echo $_GET['cat']; ?>" <?php }else{ ?>href="home?tp"<?php } ?>> <?php if(isset($_GET['cat'])){ ?><?php echo $rowCat['cat_name']; ?> Top Pictures<?php } elseif(isset($_GET['tp'])||isset($_GET['alltp'])){ ?><strong>Top Pictures</strong><?php } else{ ?>Blabben Top Pictures<?php } ?></a></div> </div> </div> <!--tabs end--> <!-- <div class="blabnation"> <ul class="user-dropdown"> <li <?php //if(!isset($_GET['nation'])){?>id="selected"<?php //}else{}?>><a href="home">Blab Friends</a></li> <li <?php //if(isset($_GET['nation'])){?>id="selected"<?php //}else{}?>><a href="home?nation">Blab Nation</a></li> </ul> </div> --> <!--content--> <div id="content" class="round1"> <?php if(!isset($_GET['top'])){ $objBP = new dbConfig(); $objBP1 = new dbConfig(); //echo $_GET['cat']; if(isset($_GET['cat'])&&!isset($_GET['tp'])){ $cate = "select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND follow.follower = ".$uinfo['user_id']." AND blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.cat_id = ".$_GET['cat']." ORDER BY blab_id DESC LIMIT 8"; $sqlBP = $objBP->selectQuery($cate); } elseif(isset($_GET['category'])){ $sqlBP = $objBP->selectQuery("select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND blabs.cat_id = categories.cat_id AND follow.follower = ".$uinfo['user_id']." AND blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.cat_id = ".$_GET['category']." ORDER BY blab_id DESC LIMIT 8"); } elseif(isset($_GET['all'])){ $sqlBP = $objBP->selectQuery("select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND blabs.cat_id = categories.cat_id AND follow.follower = ".$uinfo['user_id']." AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY blab_id DESC LIMIT 75"); } elseif(isset($_GET['tp'])&&!isset($_GET['cat'])){ $sqlBP = $objBP->selectQuery("select * from blabs,users,categories WHERE blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY blabs.blab_id DESC LIMIT 75"); //$sqlBP = $objBP->selectQuery("select * from likes,blabs,users,categories WHERE likes.blab_id = blabs.blab_id AND blabs.cat_id = categories.cat_id AND likes.show='1' AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY likes.liked DESC LIMIT 75"); } elseif(isset($_GET['tp'])&&isset($_GET['cat'])){ $t = "select * from blabs,users,categories WHERE blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.cat_id = ".$_GET['cat']." AND blabs.blab='0' ORDER BY blabs.blab_id DESC LIMIT 75"; $sqlBP = $objBP->selectQuery($t); } elseif(isset($_GET['alltp'])){ $sqlBP = $objBP->selectQuery("select * from likes,blabs,users,categories,follow WHERE follow.following = blabs.user_id AND (likes.blab_id = blabs.blab_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.cat_id = categories.cat_id) AND (likes.show='1') AND (blabs.user_id = users.user_id) AND (blabs.blab='0') ORDER BY likes.liked DESC"); } elseif(!isset($_GET['tp'])&&isset($_GET['cat'])) { $sqlBP = $objBP->selectQuery("select * from blabs,users,follow,categories WHERE (blabs.cat_id = categories.cat_id) AND (follow.following = blabs.user_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.user_id = users.user_id) AND (blabs.blab='0') AND (blabs.cat_id = ".$_GET['cat'].") ORDER BY blab_id DESC LIMIT 8"); } else { $sqlBP = $objBP->selectQuery("select * from blabs,users,follow,categories WHERE (blabs.cat_id = categories.cat_id) AND (follow.following = blabs.user_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.user_id = users.user_id) AND (blabs.blab='0') ORDER BY blab_id DESC LIMIT 8"); } ?> <script> function deleteblab(blab){ c = confirm("Are you sure you want to delete this?"); if(c==true){location.href = "models/picblab_mdl.php?bid="+blab+"&delete=blab"} } </script> <!--blab--> <div id="blabs-con"> <ul> <?php $c=1; while($rowblab = mysql_fetch_array($sqlBP)){ ?> <?php //count likes $objLike = new dbConfig(); $sqlLike = $objLike->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']); $countLike = mysql_num_rows($sqlLike); //find if person liked $objLike1 = new dbConfig(); $sqlLike1 = $objLike1->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']." AND user_id = ".$uinfo['user_id']); $countLike1 = mysql_num_rows($sqlLike1); //get comments $objBs = new dbConfig(); $sqlBs = $objBs->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']); $countBs = mysql_num_rows($sqlBs); //get repics $objRe = new dbConfig(); $sqlRe = $objRe->selectQuery("select * from blabs WHERE reblab = ".$rowblab['blab_id']); $countRe = mysql_num_rows($sqlRe); ?> <li class="box"> <div class="blabs" fancybox> <!--fancybox srart--> <!-- Add mousewheel plugin (this is optional) --> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script> <!-- Add fancyBox main JS and CSS files --> <script type="text/javascript" src="js/fancybox/jquery.fancybox.js"></script> <link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox.css" media="screen" /> <!--fancybox end--> <script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'fade', 'width' : 615, 'height' : 'auto', 'type' : 'img' }); }); </script> <script> $(document).ready(function(){ //$('#commentwr<?php //echo $c; ?>').hide(); $('#commentbt<?php echo $c; ?>').click(function(){ //$('#commentwr<?php //echo $c; ?>').slideToggle('slow'); $('#comment<?php echo $c; ?>').focus(); }); }); </script> <?php if($_SESSION['UserInfo'][0]==$rowblab['user_id']) {?> <div class="delete1"><a href="javascript:;" onclick="deleteblab('<?php echo $rowblab['blab_id']; ?>')"><img src="images/delete.png" title="Delete this Picture" alt="Delete" /></a></div> <?php } ?> <div class="blabs-img fancybox"><!--blabs-img start--> <?php if($rowblab['blab_img']==NULL){ ?> <a class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="images/avatar.png" width="198" /></a> <?php } else { ?> <a class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="pictures/large/<?php echo $rowblab['blab_img']; ?>" width="198" /></a> <?php } ?> <div class="blab-text"><?php echo $rowblab['blab_caption']; ?></div> <div class="blab-text1"><?php echo $countLike; ?> likes</div> <div class="blab-text1"><?php echo $countBs; ?> blabs</div> <div class="blab-text1"><?php echo $countRe; ?> repics</div> </div><!-- blabs-img end--> <div class="like fancybox" ><img id="commentbt<?php echo $c; ?>" style="cursor:pointer;" src="images/Blab.jpg" width="61" height="18" /> <?php if($countLike1<=0){ ?> <a class="fancybox" href="models/likes_mdl.php?action=like&bid=<?php echo $rowblab['blab_id']; ?>&uid=<?php echo $rowblab['user_id']; ?>&page=home"><img src="images/Like.jpg" width="56" height="18" /></a> <?php }?> <?php if($rowblab['user_id']!=$uinfo['user_id']){ ?> <form style="float:right;" name="repic" id="repic" action="models/repic_mdl.php?action=repic" method="post"> <input name="uid" type="hidden" value="<?php echo $rowblab['user_id']; ?>" /> <input name="blab_img" type="hidden" value="<?php echo $rowblab['blab_img']; ?>" /> <input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" /> <input name="blab_caption" type="hidden" value="<?php echo $rowblab['blab_caption']; ?>" /> <input name="cat_id" type="hidden" value="<?php echo $rowblab['cat_id']; ?>" /> <input type="image" src="images/RePic.png" /> </form> <?php }?> </div> <div class="onto"> <?php if($rowblab['picture']==NULL) { ?> <span><img src="images/avatar.png" width="30" /></span> <?php } else { ?><img src="users_images/small/<?php echo $rowblab['picture']; ?>" width="30" /><?php } ?> <span><strong><a href="./<?php echo $rowblab['uname']; ?>"><?php echo $rowblab['name']; ?></a> @<?php echo $rowblab['uname']; ?></strong> onto <strong><a href="home?cat=<?php echo $rowblab['cat_id']; if(isset($_GET['tp'])){echo "&tp";} ?>"><?php echo $rowblab['cat_name']; ?></a></strong></span></div> <?php $objCom = new dbConfig(); //$coms = "select * from blabs,users,comment WHERE blabs.user_id = comment.user_id AND blabs.blab_id = comment.blab_id AND comment.blab_id = ".$rowblab['blab_id']." ORDER BY comment.com_id DESC LIMIT 2"; $sqlCom = $objCom->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']." ORDER BY com_id DESC LIMIT 2"); $comCount = mysql_num_rows($sqlCom); if($comCount>=1){ while($comments = mysql_fetch_array($sqlCom)){ ?> <div class="onto1"> <?php $objComU = new dbConfig(); $sqlComU = $objComU->selectQuery("select * from users WHERE user_id = ".$comments['user_id']); $comU = mysql_fetch_array($sqlComU); if($comU['picture']==NULL) { ?> <span><img src="images/avatar.png" width="30" /></span> <?php } else { ?><img src="users_images/small/<?php echo $comU['picture']; ?>" width="30" /><?php } ?> <span><strong><a href="./<?php echo $comU['uname']; ?>"><?php echo $comU['name']; ?></a></strong> <?php echo $comments['comment']; ?></span></div> <?php }} if($countBs>=2){ ?> <div class="onto1" style="text-align:center"> <span><strong><a href="article.php?blab=<?php echo $rowblab['blab_id']; ?>">All <?php echo $countBs; ?> comments...</a></strong></span></div> <?php } ?> <div id="commentwr<?php echo $c; ?>" class="onto1 comments" style="text-align:center"> <span><strong><form action="models/comment_mdl.php?put=blab&uid=<?php echo $rowblab['user_id']; ?>" method="post" name="comment"><input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" /><textarea name="comment" id="comment<?php echo $c; ?>" placeholder="Blab It Up" maxlength="140" style="max-width:186px; min-width:186px; width:186px; height:24px;max-height:50px;" cols="" rows=""></textarea></strong></span><br /> <input name="" type="image" src="images/Blab.jpg" style="margin-top:6px;" /></form> </div> </div> </li> <?php $c++; } ?> </ul> <?php } ?> </div> <!--blabs end--> <?php if(!isset($_GET['all'])&&!isset($_GET['category'])&&!isset($_GET['alltp'])&&!isset($_GET['tp'])) {?> <!--content 2--> <div id="content2" style="margin-bottom:20px;"> <a id="timeline"></a> <!--content left--> <div id="left"> <!--tabs--> <div id="tabs-inside"> <div class="tab-inside roundT"><a href="home"><?php if(!isset($_GET['top'])&&!isset($_GET['points'])){ ?><strong>Blabbing</strong><?php } else {?>Blabbing<?php } ?></a></div> <div class="tab-inside roundT"> <?php if(isset($_GET['cat'])){ ?><a href="home?top&cat=<?php echo $_GET['cat']; ?>"><?php if(isset($_GET['top'])) {?><strong><?php echo $rowCat['cat_name']; ?> Top Blabs</strong><?php }else { ?><?php echo $rowCat['cat_name']; ?> Top Blabs</a><?php }}else {?><a href="home?top"><?php if(isset($_GET['top'])) {?><strong>Blabben Top Blabs</strong><?php }else { ?>Blabben Top Blabs</a><?php }} ?></div> <!--<div class="tab-inside roundT"><a href="home?points"><?php //if(isset($_GET['points'])){ ?><strong>Points</strong><?php //} else {?>Points<?php //} ?></a></div>--> </div> <!--tabs end--> <div id="leftcon"> <div style="text-align: center;"><?php echo $noblab; ?></div> <ul class="statuses"><?=$timeline?></ul> </div> </div> <!--conetne left end--> <!--content right--> <div id="right"> <!--tabs--> <div id="tabs"> <div class="tab1 roundT">My Blab Profile<span class="catname1"><?php if(isset($_GET['cat'])){ echo $rowCat['cat_name']; } elseif(isset($_GET['category'])){ echo $rowCat['cat_name']; } ?></span></div> </div> <!--tabs end--> <!--profile--> <div id="blab-profile"> <div id="profile"> <?php if($uinfo['picture']==NULL) { ?> <img src="images/avatar.png" width="50" /> <?php } else { ?><img src="users_images/large/<?php echo $uinfo['picture']; ?>" width="50" /><?php } ?><span> </span><?php echo $uinfo['name']; ?><br /> <a href="<?php echo $uinfo['uname']; ?>">View Profile page</a></div> <!--counts--> <div id="counts"> <div id="count-blabs1"> <?php $objBlab = new dbConfig(); $sqlBlab = $objBlab->selectQuery("select * from blabs WHERE user_id = ".$_SESSION['UserInfo'][0]); $countBlab = mysql_num_rows($sqlBlab); $objF = new dbConfig(); $sqlF = $objF->selectQuery("select * from follow WHERE follower = ".$_SESSION['UserInfo'][0]); $following = mysql_num_rows($sqlF); $objF1 = new dbConfig(); $sqlF1 = $objF1->selectQuery("select * from follow WHERE following = ".$_SESSION['UserInfo'][0]); $follower = mysql_num_rows($sqlF1); $objPoints = new dbConfig(); $sqlPoints = $objBlab->selectQuery("select * from users WHERE user_id = ".$_SESSION['UserInfo'][0]); $countPoints = mysql_fetch_array($sqlPoints); ?> <span><?php echo $countBlab; ?></span><br /> <a href="profile">BLABS</a></div> <div id="count-points1"><span><?php echo $countPoints['points']; ?></span><br /> <a href="profile">POINTS</a></div> </div> <!--counts end--> <!--counts--> <div id="counts"> <div id="count-follow1"><span><?php echo $following; ?></span><br /> <a href="profile?following">FOLLOWING</a></div> <div id="count-follower1"><span><?php echo $follower; ?></span><br /> <a href="profile?followers">FOLLOWERS</a></div> </div> <!--counts end--> <?php $objbid = new dbConfig(); $qb = "select * from blabs order by blab_id desc limit 1"; $sqlbid = $objbid->selectQuery($qb); $bid= mysql_fetch_array($sqlbid); $b_id = $bid['blab_id']+1; ?> <div id="blabit-up"> <form id="blabfrm" name="blabfrm" method="post"> <textarea name="blab" id="blab" placeholder="Blab It Up" class="validate[required] text-input" tabindex="1" rows="2" cols="40" onKeyDown="textCounter(document.blabfrm.blab,document.blabfrm.counterb,160)" onKeyUp="textCounter(document.blabfrm.blab,document.document.blabfrm.counterb,160)"><?php if(isset($_GET['cat'])){?>wrote onto <?php echo $rowCat['cat_name'].": "; ?><?php }elseif(isset($_GET['category'])) { ?>wrote onto <?php echo $rowCat['cat_name'].": "; }?></textarea> <input name="name" type="hidden" value="<?php echo $_SESSION['UserInfo'][1]; ?>" /> <input name="state" type="hidden" value="<?php echo $_SESSION['UserInfo'][6]; ?>" /> <input name="city" type="hidden" value="<?php echo $_SESSION['UserInfo'][5]; ?>" /> <input name="picture" type="hidden" value="<?php echo $_SESSION['UserInfo'][10]; ?>" /> <input name="uname" type="hidden" value="<?php echo $_SESSION['UserInfo'][4]; ?>" /> <input name="cat_id" type="hidden" value="<?php if(isset($_GET['cat'])) { echo $_GET['cat']; } elseif(isset($_GET['category'])) { echo $_GET['category']; } else { echo "35"; }?>" /> <input name="blab_id" type="hidden" value="<?php echo $b_id; ?>" /> <span class="catname"><?php if(isset($_GET['cat'])){ echo "<span style='text-transform: capitalize;'>".$rowCat['cat_name']."</span>"; }elseif(isset($_GET['category'])){ echo "<span style='text-transform: capitalize;'>".$rowCat['cat_name']."</span>"; } ?></span> <input name="counterb" class="counter" style="border:none; background:none;margin: 0; width: 50px;" disabled="disabled" value="160" type="text" /> <!--<span style="min-width:100px" class="counter">160</span>--> <input class="submitButton inact" name="submit" type="submit" value=" " disabled="disabled" /> <div class="clear"></div> </form> </div> </div> <!--blab of day--> <div id="tabs"> <div class="tab1 roundT" style="margin-top:10px;">Blab of the day</div> </div> <?php $objday = new dbConfig(); $sqlday = $objday->selectQuery("select * from trending WHERE trending_active = '1' ORDER BY trending_id DESC"); $bofdayn = mysql_num_rows($sqlday); if($bofdayn<=0){ ?> <div class="recent-comments" style="background: none repeat scroll 0 0 #FFFFFF; margin-left: 6px; width: 93%;"> <div class="pinned"><strong>No Blab</strong></div> </div> <?php } else { while($bofday = mysql_fetch_array($sqlday)){ ?> <div class="recent-comments" style="background: none repeat scroll 0 0 #FFFFFF; margin-left: 6px; width: 93%;"> <!-- onclick="document.getElementById('q').value='<?php //echo $bofday['trendings']; ?>'"--> <div class="pinned" style="padding-left:13px;"><a href="search?q=<?php echo $bofday['trendings']; ?>" id="bofday"><?php echo $bofday['trendings']; ?></a></div> </div> <?php }} ?> <!--blab of day end--> </div> <!--profile end--> </div> <!--conetne right end--> </div> <!--content 2 end--> <?php } ?> </div> <!--content end--> </div> <!--wrapper end--> <script src="js/masonry/jquery.masonry.min.js"></script> <script> $(function(){ var $container = $('#blabs-con'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector : '.box', columnWidth : 0 }); }); }); </script> </body> </html> <?php $content = ob_get_contents(); ob_end_clean(); require_once("mainTemplate.php"); ?> As the topic sais i have a problem trying to send variables to a javascript popup window, i think the problem is on line 38. I would very much appreciate some help Code: [Select] <html> <head> <script type="text/javascript"> function newPopup(url) { popupWindow = window.open(url,'popUpWindow','height=700,width=400,left=10,top=10,resizable=no,scrollbars=no,toolbar=yes,menubar=no,location=no,directories=no,status=yes') } </script> </head> <?php error_reporting(E_ALL); require_once 'GameQ.php'; $servers = array( 'server 1' => array('cs', 'd2o.warzone.nu', '27015'), 'server 2' => array('cs', 'd2o.warzone.nu', '27017'), 'server 3' => array('cs', 'wc3.warzone.nu', '27017'), 'server 4' => array('cs', 'aim.warzone.nu', '27015'), 'server 5' => array('cs', '83.255.249.204', '27025'), 'server 6' => array('tf2', 'tf2.warzone.nu', '27015'), 'server 7' => array('tf2', '83.255.249.200', '27015'), 'server 9' => array('cssource', 'css.warzone.nu', '27015'), 'server 10' => array('cssource', 'css.warzone.nu', '27017') ); $gq = new GameQ(); $gq->addServers($servers); $gq->setOption('timeout', 200); $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); $results = $gq->requestData(); echo "<a href='steam://connect/d2o.warzone.nu:27015'>" . $results["server 1"]['gq_hostname'] . "</a><p>"; echo $results["server 1"]['gq_mapname'] . "<br>"; echo $results["server 1"]['gq_numplayers'] . "/" . $results["server 1"]['gq_maxplayers']; ?> // I think the problem is the line below this one <a href='JavaScript:newPopup("players.php?address=<?php echo="$results['server 1']['gq_address']"; ?>&port=<?php echo="$results['server 1']['gq_port']"; ?>");'> players online </a>"; <?php echo "<p><p>"; echo "<a href='steam://connect/d2o.warzone.nu:27017'>" . $results["server 2"]['gq_hostname'] . "</a><p>"; echo $results["server 2"]['gq_mapname'] . "<br>"; echo $results["server 2"]['gq_numplayers'] . "/" . $results["server 2"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/wc3.warzone.nu:27017'>" . $results["server 3"]['gq_hostname'] . "</a><p>"; echo $results["server 3"]['gq_mapname'] . "<br>"; echo $results["server 3"]['gq_numplayers'] . "/" . $results["server 3"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/aim.warzone.nu:27015'>" . $results["server 4"]['gq_hostname'] . "</a><p>"; echo $results["server 4"]['gq_mapname'] . "<br>"; echo $results["server 4"]['gq_numplayers'] . "/" . $results["server 4"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/83.255.249.204:27025'>" . $results["server 5"]['gq_hostname'] . "</a><p>"; echo $results["server 5"]['gq_mapname'] . "<br>"; echo $results["server 5"]['gq_numplayers'] . "/" . $results["server 5"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/tf2.warzone.nu:27015'>" . $results["server 6"]['gq_hostname'] . "</a><p>"; echo $results["server 6"]['gq_mapname'] . "<br>"; echo $results["server 6"]['gq_numplayers'] . "/" . $results["server 6"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/83.255.249.200:27015'>" . $results["server 7"]['gq_hostname'] . "</a><p>"; echo $results["server 7"]['gq_mapname'] . "<br>"; echo $results["server 7"]['gq_numplayers'] . "/" . $results["server 7"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/tf2.warzone.nu:27015'>" . $results["server 8"]['gq_hostname'] . "</a><p>"; echo $results["server 8"]['gq_mapname'] . "<br>"; echo $results["server 8"]['gq_numplayers'] . "/" . $results["server 8"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/css.warzone.nu:27015'>" . $results["server 9"]['gq_hostname'] . "</a><p>"; echo $results["server 9"]['gq_mapname'] . "<br>"; echo $results["server 9"]['gq_numplayers'] . "/" . $results["server 9"]['gq_maxplayers'] . " players online <p>"; echo "<p><p>"; echo "<a href='steam://connect/css.warzone.nu:27017'>" . $results["server 10"]['gq_hostname'] . "</a><p>"; echo $results["server 10"]['gq_mapname'] . "<br>"; echo $results["server 10"]['gq_numplayers'] . "/" . $results["server 10"]['gq_maxplayers'] . " players online <p>"; ?> </html> |