dreamwest
-
Posts
1,223 -
Joined
-
Last visited
Never
Posts posted by dreamwest
-
-
Just an adjust to the page links:
This assumes you have 30 items per page
$page = 1; $tpage = ceil( $total_pics / 30 ); $startfrom = ( $page - 1 ) * 30; $start_num = $startfrom + 1; $end_num = $startfrom + $total_pics; $prev = $page - 1; $next = $page + 1; $adjust = 9; if ( 1 < $page ) { $page_links_pics .= "<a class=pagination_prev href='".$prev."'><< Prev</a><a class=pagination_next href='1'>1</a>...."; } $k = $page - $adjust; for ( $page ; $k <= $page + $adjust; ++$k ) { if (( 0 < $k ) && ( $k <= $tpage ) ) { if(($page)==($k)){ $page_links_pics.="<span class=\"pagination_active\"> ".$k." </span>"; } else { $page_links_pics .= "<a class=pagination href='".$k."'>{$k}</a>"; } } } if ( $page < $tpage ) { $page_links_pics .= ".....<a class=pagination_next href='".$tpage."'>".$tpage."</a><a class=pagination_next href='".$next."'>Next >></a>"; }
-
For a while I had planned on having one dynamic page where information can be called to make it look like multiple pages. But I recently relized that then the page could not be posted as a link for others to see.
You can. In fact you can have millions of pages generated from one php page
RewriteRule ^view=(.*) index.php?id=$1 [L,QSA]
Where view can be anything http://site.com/view=kdjfkjkdj OR http://site.com/view=35331531 etc..
-
Using classes to simply get remote data is overkill.
I would personally exec curl directly to the xml play list and use pregmatch to separate the data
-
Found a live demo http://kml-samples.googlecode.com/svn/trunk/interactive/index.html
Looks like fun!
-
Yes. But you will need to style the <p>
div.trans { width:400px; height:180px; margin:30px 50px; background-color:#ffffff; border:1px solid black; /* for IE */ filter:alpha(opacity=60); /* CSS3 standard */ opacity:0.6; } div.trans p { margin:30px 40px; font-weight:bold; color:#000000; } </style> </head> <body> <div class="trans"> <p>Hi im testing my opacity</p> </div>
-
You question makes absolutely no sense.
Is there an api for google earth, i mean its still a program it could be converted to a script
Anyways i think im on the right path:
http://groups.google.com/group/kml-support
-
Can i get Google Earth for my website?
My laptop has a tough time running the application but it would be great to have it accessible from my own website. When i get bored i like to travel via google earth
-
The htaccess option is the best
ErrorDocument 404 /index.htm
If your just using it to redirect wrong urls htaccess will do it for you, but if you really want to you can do it this way
ErrorDocument 404 /error.php
And in error.php
function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect("http://site.com/"); //redirect anywhere you want
-
I cooked up this:
function video_gen($min=6,$max=6,$id){ /*has a default min value of 6 and maximum value of 6*/ $vid=""; // to store generated password for($i=0;$i<rand($min,$max);$i++){ $num=rand(48,122); if(($num >= 97 && $num <= 122)) $vid.=chr($num); else if(($num >= 65 && $num <= 90)) $vid.=chr($num); else if(($num >=48 && $num <= 57)) $vid.=chr($num); else $i--; } return $vid; } $vid = video_gen(6,6, 87458 ); $result = mysql_query("SELECT id FROM videos WHERE vid='{$vid}' "); if($result){ $video_num = mysql_num_rows( $result ); if ($video_num == 0) { mysql_query("insert into videos set vid ='{$vid}' "); } }
Outputs somthing like "WcAEwG"
Thus resulting in unique ids for every video......HOWEVER i think it would be a problem checking 180million + rows.
-
How does youtube generate their video ids??
Most of them are only 5-12 chars long and they have over 180 Million videos
watch?v=ewfFcmdSdck
-
You dont need an xml list to redirect for a file download
function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect("http://www.sqweasel.com/files/70dd27861e3dea2d.flv");
and in htaccess force the download
# instruct browser to download multimedia files AddType application/octet-stream .avi AddType application/octet-stream .mpg AddType application/octet-stream .wmv AddType application/octet-stream .mp4 AddType application/octet-stream .mov
-
$str = "&iuiihi&"; echo htmlentities($str);
-
ErrorDocument 404 /index.htm
Or within any page
function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); }
-
hmm...dunno why you really need 2 foreach loops...you could probably optimize your code, but whatever, not within scope of this thread.
foreach($search as $word){ $a[] = $word; } foreach($tags as $tag){ $a[] = $tag; } shuffle($a); foreach($a as $all_row){ echo $all_row; }
Thanks - works like a charm
-
Thanks.
But ive still need to keep the 2 foreach loops for processing reasons
I still cant figure out how to create an array from a loop
foreach($search as $word){ $row1 .= $word; } foreach($tags as $tag){ $row2 .= $tag; } $a = array_rand(array_merge($row1, $row2)); foreach($a as $all_row){ echo $all_row; }
-
I have 2 seperate foreach loops is there a way i can intermix the results?
foreach($search as $word){ $word; } foreach($tags as $tag){ echo $tag; }
Both loop 5 times each.
foreach word has:
apple
bannana
orange
peel
grape
foreach tag has
seeds
long
color
external
round
What i wanted to do was randomly intermix the 2 so it would look like something this:
apple
bannana
seeds
external
orange
peel
long
grape
color
round
-
That got it - Thanks!
-
I have a for loop and im trying to add the previous number to the next:
for(blaablaa){ $total = 15; //first total is 15 second total is 2 echo $total; ++$total; }
It just echos out 15 and 2 seperately, how can i add these so i get 17
-
In austrilaia you can get a usb plugin for 30 bucks that gets every channel in Australia for free. It also has the ability to receive any channel in the world, if your ariel/dish is strong enough.
Something like this could be modified to receive receptions from the internet instead of an ariel
If something costs 30 bucks, it isn't free.
Your more intelligent than that.....You know what i mean
Anyway whats $30 its like nothing, ill spend $70 on lunch 4 times a week
-
In austrilaia you can get a usb plugin for 30 bucks that gets every channel in Australia for free. It also has the ability to receive any channel in the world, if your ariel/dish is strong enough.
Something like this could be modified to receive receptions from the internet instead of an ariel
-
Your page is offset by md5 checksum , if the md5 is the same the crawler wont spider it again. Changing the title all the time wont affect how relevant the page is.
eg. the old http://site.com/page.html will be overwritten with your new http://site.com/page.html page
-
$html = file_get_contents('http://www.megaupload.com'); //d=SFMTFBRV preg_match_all('~d\s?=\s?(.*?)~is', $html, $matches); foreach ($matches[1] as $link) { $link = trim($link); echo "http://www.megaupload.com/?{$link}<br>"; }
-
i want to move my inserts to another database but still query the original and the new one at the same time
Why?
Im getting scared! I have no idea how much a mysql table can hold.
And my hosting company limits databases over 150MB
-
I have a database with 2 million + rows and about 70MB in size, i want to move my inserts to another database but still query the original and the new one at the same time
i may end up with 20 or so databases this size and still need to simultaneously query them.
Is there an easy way to query multiple databases with the same fields??
I can do this as 2 seperate queries but if i can i would like to combine it into one query
2 seperate queries/databases:
$con1 = mysql_connect("local", "user", "pass") or die(mysql_error()); mysql_select_db("db1", $con1) or die(mysql_error()); // make another connection for saving purposes $con2 = mysql_connect("local", "user", "pass") or die(mysql_error()); mysql_select_db("db2", $con2) or die(mysql_error()); $result = mysql_query ("SELECT * from sites order by id asc ", $con2) or die(mysql_error()); $num = mysql_num_rows( $result ); etc....
What is wrong with this?
in PHP Coding Help
Posted