Results 1 to 10 of 11
Threaded View
-
17th May 2010, 02:02 PM #8MemberWebsite's:
litewarez.net litewarez.com triniwarez.comif you understood functions/methods/classes and how there stored in scope then you would realise that what your doing is wrong!
PHP Code:{php}
function alexaRank($domain){
$remote_url = 'http://data.alexa.com/data?cli=10&dat=snbamz&url='.trim($domain);
$search_for = '<POPULARITY URL';
if ($handle = @fopen($remote_url, "r")) {
while (!feof($handle)) {
$part .= fread($handle, 100);
$pos = strpos($part, $search_for);
if ($pos === false)
continue;
else
break;
}
$part .= fread($handle, 100);
fclose($handle);
}
$str = explode($search_for, $part);
$str = array_shift(explode('"/>', $str[1]));
$str = explode('TEXT="', $str);
return $str[1];
} // CREATE THE FUNCTION INSTANCE OUT OF THE LOOP
{/php}
{foreach from=$linkdetail item=linkdetail}
{php}
echo alexaRank($linkdetail.URL); //not sure if you can pull smarty vars into php blocks
{/php}
<table border="0">
<tr><td colspan="2"><h2>{$linkdetail.TITLE}</h2></td></tr>
<tr>
<td rowspan="4">
<img src="http://msnsearch.srv.girafa.com/srv/i?s=MSNSEARCH&r={$linkdetail.URL}" align="absmiddle" border="1" width="160" alt="{$linkdetail.TITLE}" />
</td>
<td><strong>Title: </strong></td>
<td><a href={$linkdetail.URL}>{$linkdetail.TITLE}</a></td>
</tr>
<tr>
<td><strong>URL: </strong></td>
<td>{$linkdetail.URL}</td>
</tr>
<tr>
<td><strong>Description: </strong></td>
<td>{$linkdetail.DESCRIPTION}</td>
</tr>
<tr>
<td><strong>Page Rank: </strong></td>
<td>{$linkdetail.PAGERANK}</td>
</tr>
<tr>
<td><strong>Googles Alexa Rank: </strong></td>
<td> {php}echo alexaRank("google.com");{/php}</td>
</tr>
<tr>
<td><strong>Alexa Rank of {$linkdetail.TITLE} </strong></td>
<td> {php}echo alexaRank($linkdetail.URL);{/php}</td>
</tr>
</table>
{/foreach}
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Need Coding
By Sanny in forum Web Development AreaReplies: 4Last Post: 23rd Sep 2012, 03:52 PM -
Zen Coding - Set of plugins for HTML and CSS hi-speed coding
By soft2050 in forum Web Development AreaReplies: 5Last Post: 19th Feb 2012, 09:31 PM -
[Hiring] Coding from PSD to IPB
By Shad0w in forum Completed TransactionsReplies: 0Last Post: 27th Dec 2011, 08:06 PM -
need help with coding
By SᴩiDᴇЯ in forum vBulletinReplies: 0Last Post: 1st Mar 2011, 07:15 AM -
VB Coding Help
By DeLeTeD in forum vBulletinReplies: 5Last Post: 28th Jun 2010, 05:28 AM
themaCreator - create posts from...
Version 3.47 released. Open older version (or...