TopSite and detail page

Bug Reporting and Feature Suggestions /Improvements go here.

Moderator: pgolovko

TopSite and detail page

Postby peci » 12/09/2007 8:48 am

:blob: :blob:

New field in table links

Code: Select all
`hits` mediumint(5) NOT NULL default '1'


New file in root - links.php
Code: Select all
<?php

require_once("./admin/database.php");


$result = mysql_query("SELECT id, url, title, description, date, recip, gpr, hits FROM links WHERE id='$id' ")
or die(mysql_error());
while($row = mysql_fetch_assoc($result))
             {
echo "<a href=\"out.php?id=$row[id]\">$row[title]</a>";

echo "<br>";
echo "Title: ";
echo $row[title];
echo "<br>";
echo "URL: ";
echo $row[url];
echo "<br>";
echo "Detail: ";
$textya = $row['description'];

echo $textya;
echo "<br>";
echo "Date: ";
echo $row[date];
echo "<br>";

echo "Google Page Rank: ";
echo $row[gpr];
echo "<br>";
echo "Hits Out: ";
echo $row[hits];
$link = $row[url];

}
?>


New file in root - out.php

Code: Select all
<?php
session_start();
require_once("./admin/database.php");
$result = mysql_query("SELECT id, hits, url FROM links WHERE id='$id' ")
or die(mysql_error()); 
while($myrow = mysql_fetch_assoc($result))
{
$resulty = mysql_query("UPDATE links SET hits=hits+'1' WHERE id='$id'")
or die(mysql_error()); 
$redirect = $myrow['url'];
?>
<SCRIPT LANGUAGE="JavaScript">
redirTime = "550";
redirURL = "<?php echo $redirect ?>";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
//  End -->
</script>
<BODY onLoad="redirTimer()">
<?php

}
?>


New file in root - popular.php

Code: Select all
<?php
require_once("./admin/database.php");


$result = mysql_query("SELECT id, url, title, description, date, recip, gpr, hits, email FROM links ORDER BY hits desc LIMIT 20;")
or die(mysql_error());
while($myrow = mysql_fetch_assoc($result))
             {
echo "<b><a href=\"out.php?id=$myrow[id]\"><h4>$myrow[title]</h4></a></b>";
$link = $myrow[url];
?>
<br>


<?php
echo "<br>";
echo "URL: ";
echo $myrow[url];
echo "<br>";
echo "Detail: ";
$textya = $myrow['description'];
echo = $textya;
echo "<br>";
echo "Date: ";
echo $myrow[date];
echo "<br>";

echo "Google Page Rank: ";
echo $myrow[gpr];
echo "<br>";
echo "<b>Hits Out: ";
echo $myrow[hits];
echo "</b><br>";


}
?>


and in admin/templates/body.html


Code: Select all
{foreach from=$links item=item key=key}

<a href="/links.php?id={$item.id}"><b>{$item.title}</b></a><br>
{if $item.description <> ""}{$item.description}<br />{/if}</font>
peci
 
Posts: 13
Joined: 07/05/2007 12:48 am


Postby bihlink » 12/09/2007 9:50 pm

Cool. Thanks for sharing this. I'll try it :salute:
bihlink
 
Posts: 67
Joined: 05/08/2007 1:53 am

Postby peci » 10/09/2008 12:42 pm

Google BackLinks:
google.php
Code: Select all

<?php
require_once("./admin/database.php");


$result = mysql_query("SELECT url, title, description, id, date, recip, gpr, email FROM links WHERE id='$id' ")
or die(mysql_error());
while($myrow = mysql_fetch_assoc($result))
             {
echo "<b><a href=\"out.php?id=$myrow[id]\"><br><br><center><h4>$myrow[title]</h4></center></a></b>";
echo "<a href=\"links.php?id=$myrow[id]\"><center>Link</center></a>";
$link = $myrow[url];
?>
<br>
<img src="http://open.thumbshots.org/image.pxf?url=<?php echo $link ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';"> <br>

<?php
$link = $myrow[url];
function fetch_google($uri) {
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=link:'.$uri;
$v = file_get_contents($url);
preg_match('/of about \<b\>(.*?)\<\/b\>/si',$v,$r);
return ($r[1]) ? $r[1] : '0';
}
echo "<br>";
echo "<strong>Google Backlinks $myrow[title]: " . fetch_google($link) . "</strong><br>";

echo "<br>";
echo "URL: ";
echo $myrow[url];
echo "<br>";
echo "Date: ";
echo $myrow[date];
echo "<br><br>";
echo "NOTE: Google is a registered trademark of Google Inc. Sajtovi.org is not affiliated with Google. Trademarks remain trademarks of their respective companies.......";


echo "</b><br>";

}
}
?>
peci
 
Posts: 13
Joined: 07/05/2007 12:48 am

Postby peci » 10/09/2008 12:45 pm

Alexa Ranking
alexa.php
Code: Select all
<?php
require_once("./admin/database.php");


$result = mysql_query("SELECT url, title, description, id, date, recip, gpr, email FROM links WHERE id='$id' ")
or die(mysql_error());
while($myrow = mysql_fetch_assoc($result))
             {
echo "<b><a href=\"out.php?id=$myrow[id]\"><br><br><center><h4>$myrow[title]</h4></center></a></b>";
echo "<a href=\"links.php?id=$myrow[id]\"><center> Link</center></a>";
$link = $myrow[url];
?>
<br>
<img src="http://open.thumbshots.org/image.pxf?url=<?php echo $link ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';"> <br>

<?php
$link = $myrow[url];
function fetch_alexa($uri){
$uri = trim(eregi_replace('http://', '', $uri)); $uri = trim(eregi_replace('http', '', $uri));
$url = 'http://data.alexa.com/data?cli=10&dat=snbamz&url=' . urlencode($uri);
$v = file_get_contents($url);
preg_match('/\<popularity url\="(.*?)" TEXT\="([0-9]+)"\/\>/si', $v, $r);
return ($r[2]) ? $r[2] : '0';
}
echo "<br>";
echo "<strong>Alexa Ranking $myrow[title]: " . fetch_alexa($link) . "</strong><br />";

echo "<br>";
echo "URL: ";
echo $myrow[url];
echo "<br>";
echo "Date: ";
echo $myrow[date];
echo "<br><br>";


echo "</b><br>";

}
}
?>

http://www.sajtovi.org/links.php?id=1249 :blob:
peci
 
Posts: 13
Joined: 07/05/2007 12:48 am

Postby trapprs » 04/02/2009 9:36 pm

What do the google.php and alexa.php pages have to do with the popular lists... and how do they integrate into the website?

I think I am misunderstanding something here...

Thanks, Chris
trapprs
 
Posts: 67
Joined: 11/30/2006 5:15 pm

Postby peci » 05/11/2009 11:30 am

peci
 
Posts: 13
Joined: 07/05/2007 12:48 am



Return to Bug Reporting

Who is online

Users browsing this forum: No registered users and 0 guests

cron