Jump to content

Recommended Posts

  • Moderators
Posted

Pentru a vinde sau urca ceva pe Marketplace iti trebuie un cont cu licenta cumparata.

Cum a zis Courage.. Un micut php cu un select + order by + limit = X ( X cati vrei sa iti arate ) si cam asta a fost totu :)

PHP Developer - Not available for freelancing right now

Daca ai de gand sa postezi la categoria IPB, nu uita sa citesti regulamentul: Link regulament

Posted

Pentru a vinde sau urca ceva pe Marketplace iti trebuie un cont cu licenta cumparata.

Cum a zis Courage.. Un micut php cu un select + order by + limit = X ( X cati vrei sa iti arate ) si cam asta a fost totu :)

Treaba e că Eu + php = baba și mitraliera :))

Posted

Nu există Vlad. . 

Cum a zis și Courage..doar el poate face, eu sincer, nu am mai văzut pe niciun forum chestia asta, ar fi genial dacă s-ar scoate așa ceva. 

  • Moderators
Posted

Mneh...
 
Adaugati din boardindextemplate, dupa

<foreach loop="side_blocks:$side_blocks as $block">
	{$block}
</foreach>

 
codul urmator:

<php>
require 'conf_global.php';
function conectare_baza_de_date($host, $user, $pass, $db)
{
    $mysqli = new mysqli($host, $user, $pass, $db);
    if($mysqli->connect_error)
    {
        die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
    }
    return $mysqli;
}


$conexiune = conectare_baza_de_date($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'], $INFO['sql_database']);

$CONTENT = '';

$sql = "SELECT * FROM members ORDER BY members_profile_views DESC LIMIT 5";
$numar = 0;
$query = mysqli_query($conexiune, $sql) or die(mysqli_error($conexiune));
while ($rand = mysqli_fetch_array($query))
{
$numar++;
if ($numar != 1 AND $numar != 5){

$CONTENT .= "
<ul class='ipsList'>

        <li class='hentry row2 altrow' style='padding: 10px; border-bottom: 1px solid #111; border-top: 1px solid #252525; '>       
                      ".$rand['name']."<div style='float: right'> ".$rand['members_profile_views']." vizualizari</div>              
                   </li></ul>

";
}
elseif ($numar == 1){

$CONTENT .= "
<ul class='ipsList'>

        <li class='hentry row2 altrow' style='padding: 10px; border-bottom: 1px solid #111; margin-top: -5px !important;'>       
                     ".$rand['name']."<div style='float: right'> ".$rand['members_profile_views']." vizualizari</div>    </li></ul>

";

}

elseif ($numar == 5){

$CONTENT .= "
<ul class='ipsList'>

        <li class='hentry row2 altrow' style='padding: 10px; border-top: 1px solid #252525; margin-bottom: -5px;'>       
                   ".$rand['name']."<div style='float: right'> ".$rand['members_profile_views']." vizualizari</div>    </li></ul>

";
}

}
</php>


<div class='ipsSideBlock clearfix' id='hook_birthdays'>
        <h3>Top 5 profile views</h3>
        <div class='_sbcollapsable'>
            
                {$CONTENT}
            
            
        </div>
    </div>


<php>
mysqli_close($conexiune);
</php>

  • Upvote 4
  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.