dreamwest
-
Posts
1,223 -
Joined
-
Last visited
Never
Posts posted by dreamwest
-
-
| is a deliminator aka a seperator
|| is OR ....so
$one = 'three'; if($one =='three' || $one=='two'){ echo "Either two or three"; }
Logically:
$one = 'three'; if($one =='three' OR $one=='two'){ echo "Either two or three"; }
-
By result??
$query = "SELECT * FROM dyomails WHERE identity = '$SomeVar'"; $results = mysql_query($query); if($line = mysql_fetch_assoc($results)) { echo $line["email"] ; echo $line["logo"]."<br>"; }
By concat:
$query = "SELECT * FROM dyomails WHERE identity = '$SomeVar'"; $results = mysql_query($query); if($line = mysql_fetch_assoc($results)) { $one .= $line["email"] ; $two .= $line["logo"]; } echo $one; echo $two;
-
I can get a single image to show up for all the videos, by using your way.
This is what i have used up to now.
but this is still not right.
You just need to loop the xml results.
If you look at this url feed:
http://gdata.youtube.com/feeds/videos?vq=funny
You will get the source, now just extract what you want with pregmatch:
<media:thumbnail url="http://i.ytimg.com/vi/IytNBm8WA1c/2.jpg" height="90" width="120" time="00:03:54.500"/>
$src = file_get_contents("http://gdata.youtube.com/feeds/videos?vq=funny"); preg_match_all('~thumbnail url\s?=\s?[\'"](.*?).jpg[\'"]~is', $src, $match); foreach ($match[1] as $tmb) { echo "<img src='{$tmb}.jpg' height='90' width='120'><br>"; }
Simple
-
You wont need {literal} tags when using external style sheets only if you add the style directly
<link rel="stylesheet" href="/style1.css" type="text/css" />
Open your browser enter:
http://localhost/SITE.COM/templates/template1/style1.css
to see if the file actually exists, if it does youll include will work
-
If you have the id you have the image.
so url:
http://www.youtube.com/watch?v=nJ6rDVKzuTM
will have thumb:
-
Remember to use die(); and echo when debugging a script, youll locate the error 10 times as fast
if(!isset($_SESSION)){ session_start(); } echo session_id(); die(); //rest of script below....
-
Direct css will need literal tags
{literal} <style> { margin: 0; padding: 0; } body { font: normal 12px Arial, Helvetica, sans-serif; margin: 0; padding: 0; }</style> {/literal}
Css can be called from an exteral file like youve shown but should contain the root command
<link rel="stylesheet" href="/style.css" type="text/css" />
Make sure you refreash the page and also check to see that $smarty->compile_check is set to true $smarty->compile_check = true; , this will force template rebuid
also if i am using a jquery plugin i need to use a script tag to call the javascript files, how do i call these javascript file from index.tpl fileJust use the {literal} javascript here{/literal} tags
-
$str = " Plain text plain text plain textplain textplain textplain text plain text plain text plain text plain text. Plain text plain text plain text plain text plain text plain text plain www.google.com/analytics text plain text plain text. Plain text plain text plain text plain text plain text plain text plain text plain text plain text plain text http://yahoo.com plain text plain text plain text plain text plain text plain text plain text plain text plain text plain text plain text. Plain text plain text plain text plain text https://www.example.com plain text plain text plain text plain text. "; preg_match_all('~http://(.*?).com~is', $str, $matches); foreach ($matches[1] as $link) { echo "<a href = 'http://{$link}.com'>{$link}</a><br>"; }
-
Use default jpg
http://i4.ytimg.com/vi/{$id_here}/default.jpg
-
{mailto address=$EmailAddress encode='javascript' subject='Hello'}
According to Google, this requires the use of Smarty and the mailto plugin to achieve. Unless you're already using it...
Who doesnt use smarty
http://www.smarty.net/manual/en/language.function.mailto.php
-
{mailto address=$EmailAddress encode='javascript' subject='Hello'}
-
HA! Youve got the comedic/sarcastic touch - I lov it!
But its not just about generation theres a whole level to website speed
Even if i could get your page generation time down from 0.019 seconds to 0.0019 seconds - that would get me mentally randy
We wouldnt just cover generation time but also ACTUAL finishing time it takes to download a page from a website
-
Can we have another section/board where ppl can post tips ask q's and get help on website speed, for ppl like me that are obsessed with page loading speed
-
A external page time on ROIDS!
$url = "http://youtube.com"; $ch = curl_init($url); $info = curl_getinfo($ch); curl_close($ch); echo 'Took ' . $info['total_time'] . ' seconds to send a request"; //Refrences/// //* "filetime" //* "total_time" //* "namelookup_time" //* "connect_time" //* "pretransfer_time" //* "speed_download" //* "speed_upload" //* "starttransfer_time" //* "redirect_time"
-
Im looking for some more theatrical music game/movie epic pieces.
Something similar to World of warcraft http://www.findtail.com/Mdownload=99461
Any suggestions would be great!!
-
Actually its similar to connecting normally the loops are the same
<table border=0 CELLPADDING=4> <tr> <td align=right>Alias</td> <td align=center><a href="http://xxxx/forumdisplay.php?f=2">Dust2Pub</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=3">Deathmatch</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=4">Deathrun</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=55">Jailbreak</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=5">KZ/Bhop</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=8">Freezetag</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=6">ZPlague</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=7">ZRevolution</a></td> </tr> <?php $con1 = mysql_connect("localhost", "quickgam_me", "xxxx") or die(mysql_error()); mysql_select_db("quickgam_amx", $con1) or die(mysql_error()); $con2 = mysql_connect("localhost", "user", "pass") or die(mysql_error()); mysql_select_db("jailbreak", $con2) or die(mysql_error()); $result = mysql_query ("SELECT * from table ", $con1) or die(mysql_error()); $result2 = mysql_query ("SELECT * from quickgam_jbamxbans", $con2) or die(mysql_error()); //////////////////////// //Now pull anything you want out of $result2 //////////////////////// $num = mysql_num_rows( $result ); $query = " SELECT admin_id, server_id, nickname, hostname, access, ashow, admintype FROM amx_amxadmins a, amx_serverinfo s, amx_admins_servers c WHERE c.admin_id = a.id AND c.server_id = s.id AND a.id = c.admin_id AND a.admintype = a.admintype AND a.ashow = a.ashow ORDER BY a.admintype DESC, a.nickname ASC"; $result = mysql_query($query, $con1) or die("CASE 1"); while($row = mysql_fetch_array($result)){ $nicks[$row['nickname']][]=$row['server_id']; $admin[$row['nickname']]=$row['admintype']; } $color="1"; foreach($nicks as $nickname=>$serverids) { if($color==1){ $hello = implode(" ",$serverids); echo "<tr bgcolor='#FFF9A1'><td align=right><b>".$nickname."</b><br>"; if($admin[$nickname]=="3"){ echo "<i>Owner</i>"; }elseif($admin[$nickname]=="2"){ echo "<i>Head Admin</i>"; }elseif($admin[$nickname]=="1"){ echo "<i>Admin</i>"; }elseif($admin[$nickname]=="0"){ echo "<i>Co-Owner</i>"; } echo "</td>"; if(strstr($hello,"4") || strstr($hello,"6") || strstr($hello,"1") || strstr($hello,"8") || strstr($hello,"17") || strstr($hello,"2") || strstr($hello,"14") || strstr($hello,"5")){ // d2pub echo "<td><center><img src='http://xxxx/yes.gif' alt=''></center></td>"; } else { echo "<td><center><img src='http://xxxx/no.gif' alt=''></center></td>"; } $color="2"; } else { $hello = implode(" ",$serverids); echo "<tr bgcolor=''><td align=right><b>".$nickname."</b><br>"; if($admin[$nickname]=="3"){ echo "<i>Owner</i>"; }elseif($admin[$nickname]=="2"){ echo "<i>Head Admin</i>"; }elseif($admin[$nickname]=="1"){ echo "<i>Admin</i>"; }elseif($admin[$nickname]=="0"){ echo "<i>Co-Owner</i>"; } echo "</td>"; if(strstr($hello,"4") || strstr($hello,"6") || strstr($hello,"1") || strstr($hello,"8") || strstr($hello,"17") || strstr($hello,"2") || strstr($hello,"14") || strstr($hello,"5")){ echo "<td><center><img src='http://xxxx/yes.gif' alt=''></center></td>"; } else { echo "<td><center><img src='http://xxxx/no.gif' alt=''></center></td>"; } $color="1"; } } ?> </tr> <tr> <td align=right>Alias</td> <td align=center><a href="http://xxxx/forumdisplay.php?f=2">Dust2Pub</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=3">Deathmatch</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=4">Deathrun</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=55">Jailbreak</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=5">KZ/Bhop</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=8">Freezetag</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=6">ZPlague</a></td> <td align=center><a href="http://xxxx/forumdisplay.php?f=7">ZRevolution</a></td> </tr> </table>
-
You need to reference the timer with time() then just offset the difference
-
Youll need a second connection:
$con1 = mysql_connect("localhost", "user", "pass") or die(mysql_error()); mysql_select_db("dbname", $con1) or die(mysql_error()); $con2 = mysql_connect("localhost", "user", "pass") or die(mysql_error()); mysql_select_db("dbname", $con2) or die(mysql_error()); $result = mysql_query ("SELECT * from table ", $con1) or die(mysql_error()); $num = mysql_num_rows( $result ); //etc etc....
-
You can cut down half your code like this
if(strstr($hello,"4") || strstr($hello,"1") etc....){ // d2pub echo "<td><center><img src='http://xxxx/yes.gif' alt=''></center></td>"; } else { echo "<td><center><img src='http://xxxx/no.gif' alt=''></center></td>"; }
You just repeating the same code...Remember :
less code = Happiness
You almost have correct code for a join , Im assuming these are seperate tables:
FROM amx_amxadmins as a, amx_serverinfo as s, amx_admins_servers as c
-
So your sying you can only get one hits block from a larger file or loop??
If so youll need to loop the result using while or foreach
-
$1, $2, $3 etc.. relates to the position of the rewrite:
RewriteRule ^test/(.*)/(.*)/(.*) test.php?id=$1&next=$2&test=$3 [L,QSA]
So logically it would look like:
RewriteRule ^test/$1/$2/$3
Also you can swich them around anyway you want:
RewriteRule ^test/$3/$1/$2
Second,I want to cover the real path:
http://www.domain.com/downloads/test/test_secret_09.php?file= and mask it with: http://www.domain.com/files/downloads/09
---
So far, I have this:
RewriteRule ^files/downloads/(.*) downloads/test/test_secret_$1.php?file= [L,QSA]
Your better of having the download script like this:
RewriteRule ^files/downloads/(.*) downloads.php?id=$1 [L,QSA]
-
Ive tried for ages to get playstation emulator working but it never seems to do anything.
NES, SNES and N64 are a piece of cake compared to Playstation.
Has anyone had any luck with this??
I want to defeat my greatest gaming nemesis ........ Alundra
-
<?php if ($pass != $info['password']) { header('Location: /login.php'); } else { print "<object codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' id='doc_804151193636402' name='doc_804151193636402' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' align='middle' height='500' width='100%' >"; print "<param name='movie' value='./flash/book.swf'>"; print "<param name='quality' value='high'>"; print "<param name='play' value='true'>"; print "<param name='loop' value='true'>"; print "<param name='scale' value='showall'>"; print "<param name='wmode' value='opaque'>"; print "<param name='devicefont' value='false'>"; print "<param name='bgcolor' value='#ffffff'>"; print "<param name='menu' value='true'>"; print "<param name='allowFullScreen' value='true'>"; print "<param name='allowScriptAccess' value='always'>"; print "<param name='salign' value=''>"; print "<embed src='./flash/book.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' play='true' loop='true' scale='showall' wmode='opaque' devicefont='false' bgcolor='#ffffff' name='doc_804151193636402_object' menu='true' allowfullscreen='true' allowscriptaccess='always' salign='' type='application/x-shockwave-flash' align='middle' height='650' width='100%'>"; print '</embed>'; print '</object>'; echo '<a href=logout.php>Logout</a>'; } } } ?>
-
Add this to htaccess - its foolproof
AddType application/octet-stream .pdf
constants not working...
in PHP Coding Help
Posted