Bob Norris Posted June 24, 2011 Share Posted June 24, 2011 Hi folks, I REALLY need this script to open a pop up rather then just target _blank. Can anyone help? Please? Its for a car site with videos of cars <?php if($row[link_url]) echo "<a href='$row[link_url]' target='_blank'>$row[link_text]</a> - "; ?> Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/ Share on other sites More sharing options...
Pikachu2000 Posted June 24, 2011 Share Posted June 24, 2011 Define what you mean by a "pop up" if you don't mean a new window. Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234148 Share on other sites More sharing options...
Bob Norris Posted June 24, 2011 Author Share Posted June 24, 2011 Define what you mean by a "pop up" if you don't mean a new window. Thank you, Yes it opens in a new window but I would like that window to be sized about 500x500. It will contain a video of the car and I dont want it on a new page all together (full page0 Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234150 Share on other sites More sharing options...
Bob Norris Posted June 24, 2011 Author Share Posted June 24, 2011 Anyone have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234267 Share on other sites More sharing options...
EdwinPaul Posted June 24, 2011 Share Posted June 24, 2011 Try it with javascript: function popUp(){ msg = window.open('','msg','width=500,height=500,resizable,scrollbars=yes,toolbar=no,location=no'); msg.document.open(); msg.document.write('<html><head><title></title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>Put your movie here </body></html>'); msg.document.close(); } Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234272 Share on other sites More sharing options...
Bob Norris Posted June 24, 2011 Author Share Posted June 24, 2011 Try it with javascript: function popUp(){ msg = window.open('','msg','width=500,height=500,resizable,scrollbars=yes,toolbar=no,location=no'); msg.document.open(); msg.document.write('<html><head><title></title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>Put your movie here </body></html>'); msg.document.close(); } I tried pasting that code in but it didnt work. I just replaced that line with your code. Anything else I can try? Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234341 Share on other sites More sharing options...
EdwinPaul Posted June 24, 2011 Share Posted June 24, 2011 You have to call that function to make it work: popUp(); at your appropriate place. Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234359 Share on other sites More sharing options...
Bob Norris Posted June 24, 2011 Author Share Posted June 24, 2011 You can see at the top the line that pulls the url. Not sure how to do this. Here is the complete page: The Call <?php if($row[link_url]) echo "<a href='$row[link_url]' target='_blank'>$row[link_text]</a> - "; ?> The Page <div class='infobar' style='margin-bottom:10px;'> <a href='listings.php?<?php echo $pass_vars; ?>'>Back to Listings</a> <div class='right'> <?php if($row[link_url]) echo "<a href='$row[link_url]' target='_blank'>$row[link_text]</a> - "; ?> <a href="javascript:new_window('video.htm', '560', '375');">Watch Video</a> - <a href="javascript:new_window('friend.php?id=<?php echo $_GET[id]; ?>', '700', '500');">Send to a Friend</a> - <a href="javascript:new_window('contact.php?id=<?php echo $_GET[id]; ?>', '700', '500');">Contact Us</a> - <a href="javascript:new_window('print.php?id=<?php echo $_GET[id]; ?>', '700', '500');">Printable Page</a> </div> </div> <table class='display' width='680' border='0' cellpadding='0' cellspacing='0'> <tr> <td width='390' valign='top'> <?php if($row[images]) { if($row[images] > 1) echo "<a href=\"javascript:new_window('slideshow.php?id=$_GET[id]', '700', '550');\">"; echo "<img class='none' name='large' src='images/$image_set[0]' alt=''/>"; if($row[images] > 1) echo "</a><p style='text-align:center;margin:5px 0;padding:0;'>Click the photo above to view a slideshow.</p>"; // if there is more than one image, display the others as thumbnails if($row[images] > 1) { echo "<table border='0' cellpadding='0' cellspacing='0'>"; echo "<tr>"; $n = 1; foreach($image_set as $image) { echo "<td style='padding-top:10px;' width='130' valign='top'>"; echo "<a href=\"javascript:swap('large', '$image');\"><img class='none' src='thumbs/$image' alt=''/></a>"; echo "</td>"; if(!($n % 3) && $n < count($image_set)) echo "</tr><tr>"; $n++; } echo "</tr>"; echo "</table>"; echo "<p style='margin-top:10px;'>Click the thumbnails above to view larger images. The larger images may take a moment to load on slower internet connections.</p>"; } } else { echo "<img src='common/no-photo-large.jpg' alt=''/>"; } ?> </td> <td width='20'><div style='width:20px;'></div></td> <td width='270' valign='top'> <table class='info' width='270' border='0' cellpadding='0' cellspacing='0'> <?php // general information echo "<tr><td class='title' colspan='2'>"; if($row[model_year]) echo $row[model_year]." "; echo "$row[make] $row[model]</td></tr>"; echo "<tr><td class='label'>Location:</td><td>$location[name]</td></tr>"; echo "<tr><td>Availability:</td><td>"; if($row[status] == 2) echo "<span class='alert'>".$status[$row[status]]."</span>"; elseif($row[status] == 3) echo "<span class='error'>".$status[$row[status]]."</span>"; else echo $status[$row[status]]; echo "</td></tr>"; if($row[stock]) echo "<tr><td>Stock Number:</td><td>$row[stock]</td></tr>"; if($row[vin]) echo "<tr><td>$conf[vin]:</td><td>$row[vin]</td></tr>"; if($row[cond]) echo "<tr><td>Condition:</td><td>$row[cond]</td></tr>"; if($row[mileage_alt]) echo "<tr><td>Usage:</td><td>$row[mileage_alt]</td></tr>"; elseif($row[mileage]) echo "<tr><td>$conf[units]:</td><td>".number_format($row[mileage])." $conf[units]</td></tr>"; if($row[ebay_url]) echo "<tr><td>Price:</td><td><a href='$row[ebay_url]' target='_blank'><img class='none' src='common/ebay-logo.gif'/></a></td></tr>"; elseif($row[price]) echo "<tr><td>Price:</td><td>".$conf[currency].number_format($row[price])."</td></tr>"; elseif($row[price_alt]) echo "<tr><td>Price:</td><td>$row[price_alt]</td></tr>"; else echo "<tr><td>Price:</td><td>Call for Price</td></tr>"; if($row[sale]) echo "<tr><td>Sale Price:</td><td><span class='success'>".$conf[currency].number_format($row[sale])."</span></td></tr>"; // dealership information if($conf[show_dealer]) { echo "<tr><td colspan='2'><hr/></td></tr>"; echo "<tr><td>Dealership:</td><td>$location[name]</td></tr>"; echo "<tr><td>Email Address:</td><td><a href=\"javascript:new_window('contact.php?id=$_GET[id]&mode=dealer', '700', '500');\">Email Dealership</a></td></tr>"; if($location[url]) echo "<tr><td>Website:</td><td><a href='$location[url]' target='_blank'>Visit Website</a></td></tr>"; if($location[phone]) echo "<tr><td>Phone Number:</td><td>$location[phone]</td></tr>"; if($location[fax]) echo "<tr><td>Fax Number:</td><td>$location[fax]</td></tr>"; if($location[address]) { echo "<tr>"; echo "<td class='label'>Address:</td>"; echo "<td>"; echo $location[address]."<br/>"; if($location[address2]) echo $location[address2]."<br/>"; if($location[city]) echo $location[city]; if($location[city] && $location[state]) echo ", "; if($location[state]) echo $location[state]; if($location[city] || $location[state]) echo "<br/>"; if($location[zip]) echo $location[zip]."<br/>"; if($location[country]) echo $location[country]; echo "</td>"; echo "</tr>"; } } // salesperson information if($user[contact]) { echo "<tr><td colspan='2'><hr/></td></tr>"; echo "<tr><td>Salesperson:</td><td>$user[name]</td></tr>"; echo "<tr><td>Email Address:</td><td><a href=\"javascript:new_window('contact.php?id=$_GET[id]&mode=sales', '700', '500');\">Email Salesperson</a></td></tr>"; if($user[phone]) echo "<tr><td>Phone Number:</td><td>$user[phone]</td></tr>"; } echo "<tr><td colspan='2'><hr/></td></tr>"; // additional details if($row[exterior]) echo "<tr><td>Exterior Color:</td><td>$row[exterior]</td></tr>"; if($row[interior]) echo "<tr><td>Interior Color:</td><td>$row[interior]</td></tr>"; if($row[doors]) echo "<tr><td>Doors:</td><td>$row[doors]</td></tr>"; if($row[fuel]) echo "<tr><td>Fuel Type:</td><td>$row[fuel]</td></tr>"; if($row[drive]) echo "<tr><td>Drive Train:</td><td>$row[drive]</td></tr>"; // engine details if($row[engine]) echo "<tr><td>Engine:</td><td>$row[engine]</td></tr>"; if($row[trans]) echo "<tr><td>Transmission:</td><td>$row[trans]</td></tr>"; if($row[top_speed]) echo "<tr><td>Top Speed:</td><td>$row[top_speed]</td></tr>"; if($row[horsepower]) echo "<tr><td>Horsepower:</td><td>$row[horsepower]</td></tr>"; if($row[torque]) echo "<tr><td>Torque:</td><td>$row[torque]</td></tr>"; if($row[towing]) echo "<tr><td>Towing Capacity:</td><td>$row[towing]</td></tr>"; ?> </table> </td> </tr> <?php // listing description if($row[description]) { echo "<tr><td colspan='3'><hr/></td></tr>"; echo "<tr><td colspan='3'>".nl2br($row[description])."</td></tr>"; } // listing features if($row[features]) { echo "<tr><td colspan='3'><hr/></td></tr>"; echo "<tr><td colspan='3'>"; $tmp = explode("\n", $row[features]); foreach($tmp as $key => $value) if(!trim($value)) unset($tmp[$key]); else $tmp[$key] = trim($value); // remove empty lines $tmp = array_unique($tmp); // remove duplicate entries $cnt = count($tmp); $num = ceil($cnt / 4); echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"; echo "<tr>"; echo "<td style='text-align:left;' width='25%' valign='top'><ul>"; $n = 1; foreach($tmp as $value) { echo "<li>$value</li>"; if($n % $num == 0 && $n < $cnt) echo "</ul></td><td style='text-align:left;' width='25%' valign='top'><ul>"; $n++; } echo "</ul></td></tr>"; echo "</table>"; echo "</td></tr>"; } ?> </table> <div class='infobar' style='margin-top:10px;'> <a href='listings.php?<?php echo $pass_vars; ?>'>Back to Listings</a> <div class='right'> <?php if($row[link_url]) echo "<a href='$row[link_url]' target='_blank'>$row[link_text]</a> - "; ?> <a href="javascript:new_window('friend.php?id=<?php echo $_GET[id]; ?>', '700', '500');">Send to a Friend</a> - <a href="javascript:new_window('contact.php?id=<?php echo $_GET[id]; ?>', '700', '500');">Contact Us</a> - <a href="javascript:new_window('print.php?id=<?php echo $_GET[id]; ?>', '700', '500');">Printable Page</a> </div> </div> Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234362 Share on other sites More sharing options...
EdwinPaul Posted June 24, 2011 Share Posted June 24, 2011 For detailed info and examples, see: http://www.w3schools.com/jsref/met_win_open.asp Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1234460 Share on other sites More sharing options...
ZulfadlyAshBurn Posted June 27, 2011 Share Posted June 27, 2011 Bob Norris, are you trying to create a lightbox? Lightbox are easy to make. If that is wad you want, google it. It have a lot of tutorials abt it. Quote Link to comment https://forums.phpfreaks.com/topic/240274-car-video-pop-up-help/#findComment-1235269 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.