Count Spots


This is the same as what we used on RMB birthday as a competition. Your guests will go around your site looking for these.

TutorialNinja Image

So lets begin,

1) Save the image above or create you own one.
2) Save the following as dot_search.php

PHP Code
  1. <?php
  2. //List of all the pages you want the dot to display.
  3. //The to numbers are the X and Y position on the screen.
  4. //Then the value is the page you want them to show on.
  5. //Remember to include a "/" before the page.
  6. $listedURL["800;100"] = "/index.php";
  7. $listedURL["300;450"] = "/aboutus.php";
  8. $listedURL["920;180"] = "/contactus.php";
  9. //End list
  10. //Get the current page the person is on
  11. $current = $_SERVER['REQUEST_URI'];
  12. //Go through all the pages above checking if they are on the same page set by "$current"
  13. foreach($listedURL as $locations => $urls){
  14. //If there is a match
  15. if($current == $urls){
  16. //Get the X and Y location
  17. $location = explode(";", $locations);
  18. //Shows the spot in a div at the set position
  19. echo '<div style="position:absolute; width:40px; height:40px; left:' . $location[0] . 'px; top:' . $location[1] . 'px; background-image:url(\'https://rmb-scripting.com/1.png\');"></div>';
  20. }
  21. }
  22. ?>


You need to change the "$listedURL" variables to suit your website.

You can have as many pages listed on the.

Hope you like the tutorial.
DanielXP's Avatar
Author:
Views:
2,533
Rating:
Posted on Monday 5th May 2008 at 11:27 AM
DanielXP
DanielXP's Avatar
Uploaded it again
Posted on Monday 5th May 2008 at 09:10 AM
krekas
krekas's Avatar
image won't load
Posted on Wednesday 11th July 2007 at 05:27 PM
FtH8er
FtH8er's Avatar
its puts like little button images around the site and your users go around and try to count them i think, its good for competitions and stuff.
Posted on Wednesday 11th July 2007 at 02:57 PM
vb_king
vb_king's Avatar
what does this do exactly?