Activity Stream
48,167 MEMBERS
6780 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1.     
    #1
    Member
    Website's:
    InstantRDP.com

    Smile 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>



    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($handle100);
                
    $pos strpos($part$search_for);
                if (
    $pos === false)
                continue;
                else
                break;
            }
            
    $part .= fread($handle100);
            
    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




  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    TvLog.me
    bump.....

    [Best Selling RDP Providers]
    BuyWindowsVPS.Com
    1Gbit USA/EU Unmetered | Prices Starting From $29.95 | Official Thread

  4.     
    #3
    The Wise One
    Website's:
    twilight.ws ddlrank.com
    Oh 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

  5.     
    #4
    Member
    Website's:
    InstantRDP.com
    It'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

  6.     
    #5
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    for 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


  7.     
    #6
    The Wise One
    Website's:
    twilight.ws ddlrank.com
    Quote Originally Posted by pankaj View Post
    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($handle100);
                
    $pos strpos($part$search_for);
                if (
    $pos === false)
                continue;
                else
                break;
            }
            
    $part .= fread($handle100);
            
    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} 
    Edit nevermind it should work lmao
    I can always be contacted by sending a tweet @twilightws

  8.     
    #7
    Member
    Website's:
    InstantRDP.com
    Quote Originally Posted by litewarez View Post
    for 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}
    lol @ you. Can't you see that its to extract alexa rank from a given page ? Therefore a loop in needed.

    I will try creating smarty plugin. I didn't think of it before.

    Quote Originally Posted by Whoo View Post
    Edit nevermind it should work lmao
    You simply quoted my code and saying it should work. ROFLMAO




  9.     
    #8
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    if 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($handle100);
                
    $pos strpos($part$search_for);
                if (
    $pos === false)
                continue;
                else
                break;
            }
            
    $part .= fread($handle100);
            
    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


  10.     
    #9
    Member
    Website's:
    InstantRDP.com
    Not working buddy. Should I PM my login details to my cPanel ? Can you have a look into it ?
    ________
    BUY AROMED VAPORIZER

  11.     
    #10
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    nope, 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


Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need Coding
    By Sanny in forum Web Development Area
    Replies: 4
    Last Post: 23rd Sep 2012, 03:52 PM
  2. Zen Coding - Set of plugins for HTML and CSS hi-speed coding
    By soft2050 in forum Web Development Area
    Replies: 5
    Last Post: 19th Feb 2012, 09:31 PM
  3. [Hiring] Coding from PSD to IPB
    By Shad0w in forum Completed Transactions
    Replies: 0
    Last Post: 27th Dec 2011, 08:06 PM
  4. need help with coding
    By SᴩiDᴇЯ in forum vBulletin
    Replies: 0
    Last Post: 1st Mar 2011, 07:15 AM
  5. VB Coding Help
    By DeLeTeD in forum vBulletin
    Replies: 5
    Last Post: 28th Jun 2010, 05:28 AM

Tags for this Thread

BE SOCIAL