Jump to content

Trevors

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Trevors's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, Im runnin a blog toplist and im using evotopsite but im about to trash it cuz it pretty much blows. So there for im writing my own but im looking for some advice how to code the tracker that tracks unique visitors on the blogs. This tracker (a image) stores all ip numbers in a mysql table and for each unique visitor the blog ranks higher. So the blogs are ranked depending on the unique visitors. So whats the best way and most optimized, i was thinking of having a a bit of code which runs once every 15 minutes and counts the unique visitors to the blog toplist which ranks em. When it runs it flags those ip numbers that have already been counted, the ip column will be set to unique so it only stores same ip once only. Does this sound like a good idea? Best Regards
  2. Hi all My harddrive crashed... and all i got left is the .frm files from the database. I have searched a lot but couldnt find anything that would help. Anyone know if its possible to save the table structure? :/ Best Regards Trevors
  3. how would the session work? Could you code a bit so i could see how you mean. Best Regards
  4. Heya all, Im currently trying to make a myspace tool where you colorize text of yours in different colors. Im moving the html code through the url and i then catch it with $_GET in another php file. I print the $output into the url, faded.php?output=$output [code] <iframe frameborder="0" name="preview" width="627" src="faded.php?output=<?print $output;?>" height="187" style=margin:0px;padding:0px;></iframe></div> <div id="Layer1" style="position:absolute; left:10px; top:216px; width:283px; height:118px; z-index:1; visibility: visible;"> [/code] I then catch it in another file using $_GET [code] if(!isset($_GET['output'])){ $output = ""; }else{ $output = $_GET['output']; $output = str_replace("~", "#", $output); Print' <div id="Layer3" style="position:absolute; left:0px; top:0px; width:627px; height:187px; z-index:3; background-color: #000000; layer-background-color: #000000; border: 1px none #000000">' . $output . '</div>'; } [/code] The problem is that i cant type very long text, is there a limit on how much the url can store? If so what other ways are there? Best Regards Trevors
  5. Heya all, Im currently runnin Evo Topsite script PRO version, i tryed to contact em but they have not replyed to my email i sent a week ago. Anyways the URLs looks like this currently,  http://www.yourdomain.com/category/animals/ but i want to change it to http://www.yourdomain.com/animals/ i mixed with the regular expression code once but messed it up, and not being able to enter the website. regular expression code looks like this currently RewriteEngine On                   RewriteRule ^sitedetails_([0-9]+).html <<path>>index.php?do=sitedetails&id=$1 [L] RewriteRule ^comments_([0-9]+).html <<path>>index.php?do=comments&id=$1 [L] RewriteRule ^category/([a-z_0-9]+)/ <<path>>index.php?cat_id=$1 [L] RewriteRule ^user_([0-9]+).html <<path>>index.php?do=user&id=$1 [L] problem is that admin login lays on yourdomain.com/admin so im not sure how to fix it. Would really appreciate some help. Best Regards Trevor
  6. Hi all, Im curious if CURL can follow a link like this "http://www.blogcatalog.com/out/slike-iz-zivota-jednog-idiota.html" then when it redirects it pulls the real url and saves it. I was gonna crawl whole http://www.blogcatalog.com/ but they got redirect urls which i dont want. Would really appreciate abit of help Best Regards Trevor
  7. Heya all Im pretty new to php and im trying to code my own blog and im having problem printing date but a bit differently. Like this (0) April 2006 (5) March 2006 (3) February 2006 (6) January 2006 (2) December 2005 (1) November 2005 (0) October 2005 (5) September 2005 (2) August 2005 (1) July 2005 (4) thats how many blog entries there is that month. My date string looks like this "2006-01-01 01:11:11" I had a look at preg_split and integer but didnt understand much i would appreciate it very much if someone could help me out im kinda stuck big time hehe. Best Regards Trevors
  8. Ah great work Vorotaev i really appreciate it. Is it somehow possible to block so you cant add more than 1 of the same name? or maybe block so you can only add 10 names overall ? Best Regards Trevors I really appreciate the help. thanks a lot.
  9. Heya all i got a small question on how to paste a text when you single click it and paste it into a textbox using javascript. Im trying to create a "message function" on one of my websites but i have never been any good at javascripting. I got one box where i list a persons friends and one send message form, when someone clicks on one of the names on the friendlist it should paste into the send to box. Is there any easyway doing this? Best Regards Trevors
  10. Heya all i just moved to a new server and now im code isnt working with cookies? i have gone through the code several times but cannot find the problem. I have searched through the code to see where it messes it up and found it but still dont know whats wrong. I would really appreciate if someone could have a look at the code. The cookie code is very important since it stops robots/proxy programs from voting (runnin a top list for websites). have a look at this code /*if ($err == 1 && $use_cookies == 1) { if ($anti_cheat[$site] == 1) $err = 2; if ($test_cookies != 1) $err = 5; }*/ i had to comment out that or else the system wouldnt work at all but i need cookies enabled as soon as possible. As i said i would be very glad if someone could have a look at it and i know im not the best programmer hehe [code] <? include "config.php"; $MinPerVote = 5; // 1 vote per 5 minutes $cookie_message = "<font color=red face=verdana size=2>Please enable cookies.</font><br>"; $vote_timeout = "12"; $use_cookies = "1"; if(isset($_GET['site'])){     $site = $_GET['site'];             } else        {     $site = $_POST['site'];         } $Time = Time() - ($MinPerVote * 60); $open = mysql_connect($dbhost, $user, $pass); $data = mysql_db_query($dbname, "DELETE FROM top_ip WHERE time < $Time");     //Links / htaccess       $data = mysql_db_query($dbname, "SELECT * FROM top_user Where sid='$site'");     if($rad = mysql_fetch_array ($data)) {           $inCID = $rad["category"];     }       $data = mysql_db_query($dbname, "SELECT * FROM top_cats Where cid='$inCID'");     if($rad = mysql_fetch_array ($data)) {           $InCurrentID = $rad["cid"];         $inCurrentCatName  = $rad["catname"];         $LLink = str_replace(" ", "-", $inCurrentCatName);         $LLink = str_replace("/", "-", $LLink);         $LLink = strtolower($LLink);     } //Which Category       $Sitecat = $inCID; //Category ID       $incatename = $inCurrentCatName; //Category name $get_rows = mysql_db_query ($dbname,"Select title,url from top_user Where sid='$site'",$db) or die (mysql_error()); if (!mysql_num_rows($get_rows) OR mysql_num_rows ($get_rows) < 1) { header("location: $url_to_folder"); } if ($gateway == 1 && $_POST['stat'] != "gate") {     if ($use_cookies == 1)    {         setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));                 } include "header.php"; ?> <br /> <style type="text/css" media="screen, tv, projection"> @import "menu.css"> </style> <TABLE Width="750" CellPadding="3" CellSpacing="0" style="border-left-width: 1px; border-right: 1px solid #3E4968; border-left: 1px solid #3E4968; border-top-width: 1px; border-bottom-width: 1px" bgcolor="#ddecf8" align="left" > <TR> <TD background="bg_menu.jpg" colspan="5" height="22"> <font color="black" face="<? echo $font_face; ?>" Size="2"<small><center><B>- <?Print "$incatename";?> Top 100</B></center></small></font> </TD> </TR> <TR> <TD> <font color="black" face="<? echo $font_face; ?>" Size="<? echo $font_size; ?>"> <small>                               <body bgcolor="#FFFFFF" onLoad="if (self != top) top.location = self.location"> <FORM ACTION="in.php" METHOD="POST"> <p align="center">&nbsp;</p> <p align="center"> <font color="black" face="<? echo $font_face; ?>" Size="5"<small><center><B><?Print "$incatename";?> Top 100</B></small></font> <p> <?       $open = mysql_connect($dbhost, $user, $pass);       $data = mysql_db_query($dbname, "SELECT * FROM top_user WHERE sid='$site'");       while($rad = mysql_fetch_array ($data)) {           $SiteTitle  = $rad["title"];                  echo "<input type=\"submit\" value=\"Vote for $SiteTitle\" name=\"SUBMIT_IMAGE\" ALT=\"ENTER TO $top_name\"><BR>\n";     //which category       $data = mysql_db_query($dbname, "SELECT * FROM top_user WHERE sid='$site'");     if($rad = mysql_fetch_array ($data)) {           $Category = $rad["category"];     } ?>             <script type="text/javascript"><!--         google_ad_client = "";         google_ad_width = 468;         google_ad_height = 60;         google_ad_format = "468x60_as";         google_ad_channel ="";         google_color_border = "ddecf8";         google_color_bg = "ddecf8";         google_color_link = "ddecf8";         google_color_url = "008000";         google_color_text = "000000";         //--></script>         <script type="text/javascript"           src="http://pagead2.googlesyndication.com/pagead/show_ads.js">         </script>              <center><p>[Please click <a href="">here</a> if you have been tricked.]</p></center>         <center><p>Voting is once every 12 hours</p></center>         <center><p>In/Out resets every 30 days</p></center> <?}?>     </p>     <p align="center">&nbsp;</p>     <INPUT TYPE="HIDDEN" NAME="site" VALUE="<?Print $site;?>">     <INPUT TYPE="HIDDEN" NAME="stat" VALUE="gate">     </FORM>     <a href=""></a> &copy; 2004 <br></font>     </small><br>     <br>     </font>     </TD>     </TR>     <TR>     <TD Colspan="6"  Align="center" background="logoborder.jpg" height="13">     </TD>     </TR>     </Table>     <font style="FONT-FAMILY: Verdana, Tahoma, Arial; FONT-SIZE: 7pt;">     <br />      <?     } else {setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));} if ($gateway == 1 && isset($_POST['site'])) {     //Finding the correct category for the website       $data = mysql_db_query($dbname, "SELECT * FROM top_user WHERE sid='$site'");     if($rad = mysql_fetch_array ($data)) {           $Category = $rad["category"];     }     //Looking up if the users is connecting through a proxy     if($_SERVER['HTTP_X_FORWARDED_FOR'] != "" && $_SERVER['HTTP_VIA'] != "") {     //Print "Proxy detected!\n";         header("location: $url_to_folder/$LLink");     exit;     }     // Checking if the website has voted within 5 minutes     $open = mysql_connect($dbhost, $user, $pass);     $data = mysql_db_query($dbname, "SELECT * FROM top_ip WHERE sid='$site'");     if($rad = mysql_fetch_array ($data)) {       header("location: $url_to_folder/$LLink");       exit;     }     else {       $Time = Time();       $data = mysql_db_query($dbname, "INSERT top_ip (sid, time) VALUES ('$site', '$Time')");     }     if ($use_cookies == 1) {         setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));     }     $cdate = date ("Ymd");     $err = 1;     $pdate = time()-(3600*$vote_timeout);     $cndate = time();     $REMOTE_ADDR=$_SERVER['remote_addr'];     $query = mysql_db_query ($dbname,"Select ip from top_hits Where sid='$site' and cdate between $pdate and $cndate and ip='$REMOTE_ADDR'",$db) or die (mysql_error());     if ($err == 1 && @mysql_num_rows($query) >= 1) $err = 2;     /*if ($err == 1 && $use_cookies == 1) {         if ($anti_cheat[$site] == 1) $err = 2;         if ($test_cookies != 1) $err = 5;     }*/     if ($err == 1) {         if ($use_cookies == 1) {             setcookie ("anti_cheat[$site]", "1",time()+(3600*$vote_timeout));     }         mysql_db_query ($dbname,"update top_user set thin=thin+1 Where sid='$site'",$db) or die (mysql_error());         mysql_db_query ($dbname,"update top_user set totin=totin+1 Where sid='$site'",$db) or die (mysql_error());//- Total in         mysql_db_query ($dbname,"update top_user set monthin=monthin+1 Where sid='$site'",$db) or die (mysql_error());//- Monthly in         mysql_db_query ($dbname,"insert into top_hits (sid,ip) values ('$site','$REMOTE_ADDR')",$db) or die (mysql_error());     }          header("location: $url_to_folder/$LLink"); } include "footer.php"; ?> [/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.