Results 1 to 10 of 11
-
17th May 2010, 04:26 AM #1OPMemberWebsite's:
InstantRDP.comLittle coding help
This is the code. I can see output for a site's alexa like GOOGLE.
But not for variable $linkdetail.URL but when I use $linkdetail.URL it gives me the link.
OUTFILE HERE - http://www.warez-core.com/details/link-1
Any help in correcting this part in the code ?
<td><strong>Alexa Rank of {$linkdetail.TITLE} </strong></td>
<td> {php}echo alexaRank($linkdetail.URL);{/php}</td>
PHP Code:{* Calculate title from path *}
{capture name="title"}
{/capture}
{strip}
{include file="header.tpl"}
{include file="top_bar.tpl"}
<div id="main">
{foreach from=$linkdetail item=linkdetail}
{php}
$domain = $linkdetail.URL;
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];
}
echo alexaRank($domain);
{/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>Google's 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}
</div>
{include file="footer.tpl"}
{/strip}
pankaj Reviewed by pankaj on . Little coding help This is the code. I can see output for a site's alexa like GOOGLE. But not for variable $linkdetail.URL but when I use $linkdetail.URL it gives me the link. OUTFILE HERE - http://www.warez-core.com/details/link-1 Any help in correcting this part in the code ? <td><strong>Alexa Rank of {$linkdetail.TITLE} </strong></td> <td> {php}echo alexaRank($linkdetail.URL);{/php}</td> Rating: 5
-
17th May 2010, 07:44 AM #2MemberWebsite's:
TvLog.mebump.....
[Best Selling RDP Providers]
BuyWindowsVPS.Com
1Gbit USA/EU Unmetered | Prices Starting From $29.95 | Official Thread
-
17th May 2010, 07:44 AM #3The Wise OneWebsite's:
twilight.ws ddlrank.comOh now I see that this is a cheap copy of ddlrank.com haha
, nice going by taking litewarez's ideas for ddlrank
Ontopic: Could you be more specific, was looking for a "bold" part in your code but couldn"t find it.I can always be contacted by sending a tweet @twilightws
-
17th May 2010, 09:29 AM #4OPMemberWebsite's:
InstantRDP.comIt's not copy to ddlrank, I had plan in my mind from many months of making a warez directory as probably there are none.
And it's completely different from ddlrank. In DDLRank they rank big DDL sites and forums. Its for people who are looking for big sites.
But mine one is a directory. It will list all small and big warez sites be it a blog, forum or anything.
________
Volcano digital review
-
17th May 2010, 01:12 PM #5MemberWebsite's:
litewarez.net litewarez.com triniwarez.comfor starters you creating functions in a loop... wft lol
foreach(....){
function xxx(){}
}
this means that the function is being created multiple times!
i see your using smarty, why not create a smarty plugin with that function and then use like
{$linkdetail.URL|alexaRank}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
-
17th May 2010, 01:32 PM #6The Wise OneWebsite's:
twilight.ws ddlrank.comI can always be contacted by sending a tweet @twilightws
-
17th May 2010, 01:53 PM #7OPMemberWebsite's:
InstantRDP.com
-
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
-
17th May 2010, 02:11 PM #9OPMemberWebsite's:
InstantRDP.comNot working buddy. Should I PM my login details to my cPanel ? Can you have a look into it ?
________
BUY AROMED VAPORIZER
-
17th May 2010, 02:28 PM #10MemberWebsite's:
litewarez.net litewarez.com triniwarez.comnope, im busy, just create a smarty_* function and use that way, will be simpler !
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
Sponsored Links
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
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...