تبلیغات در اینترنت

تبلیغات در اینترنتگیفت کارت گوگل پلی
نمایش نتایج: از 1 به 3 از 3

موضوع: درخواست متن این صفحه : Hall of Fame

  1. Top | #1
    کاربر سایت

    تاریخ عضویت
    Nov 2010
    ورژن ویبولتین
    4.0.4
    نوشته ها
    16
    مورد پسند
    7 بار
    اطلاعات
    میزان امتیاز
    0

    پیش فرض درخواست متن این صفحه : Hall of Fame

    سلام و عرض ادب
    درخواست کدهای این صفحه رو دارم
    Hall of Fame - Top vBExperience Members - Widget, Forum Block and VBA CMPS Module - vBulletin.org Forum
    توی وی بی ایران این مطلب گذاشته شده قبلا ولی کدها ناقص بود

    با تشکر




  2. گیفت کارت آیتونز

  3. Top | #2
    مدیر بازنشته

    تاریخ عضویت
    May 2011
    ورژن ویبولتین
    4.1.9
    سن
    28
    نوشته ها
    2,927
    مورد پسند
    2,829 بار
    نوشته های وبلاگ
    3
    اطلاعات
    میزان امتیاز
    356

    پیش فرض

    On my site running vBExperience 4, I needed to have a CMS Widget and Forum Block showing Top Members, aptly named as Hall of Fame. So I wrote this one. This is not a standalone widget and it is only tested with vBExperience 4 and vBulletin 4.0.6. I will try and help if you have any issues but I can't guarantee support.

    What this does:

    Not much... This is totally based on the need of my site where I wanted to show member's avatar's besides their names, titles and Experience Points. So that's all this will show. If you need anything more you will have to change the Query.


    INSTALL INSTRUCTIONS

    1) Add the CSS which we will use

    Styles & Templates > select style > Edit Template > CSS Templates > additional.css

    Add the below CSS

    Before you add the CSS, a very important point to note is that I use a 300px sidebar column on CMS and 300px sidebar on Forums. If your CMS/Forum sidebar column is of less width, you should change the CSS values accordingly. I highly recommend playing with Firebug to arrive at optimum Display.


    کد HTML:
    .clearfix { background:none repeat scroll 0 0 #FFFFFF; display:block; float:left; margin:0 5px 5px; width:95%; }  .connections_grid .grid_item { border-bottom:1px solid #AAAAAA; float:left; margin-bottom:10px; overflow:hidden; padding-bottom:10px; padding-top:10px; width:130px; }  .connections_grid .grid_item .name { float:left; font-size:10px; overflow:hidden; padding-left:10px; padding-top:5px; text-align:center; white-space:nowrap; }  .tpimg { float:left; height:45px; padding-left:5px; width:45px; }
    .allrankings { font-size:11px; text-align:center; }
    2) Create a new Templates

    For Widget:

    Styles & Templates > select style > Add Template
    Title - vbcms_widget_execphp_hof
    Template code -


    کد HTML:
    <div class="cms_widget"> <div class="block"> <div class="cms_widget_header"> <h3>{vb:raw widget_title}</h3> </div> <div class="cms_widget_content" style="float:left">         {vb:raw show_top}         </div> </div> </div>
    For Forum Block:

    Styles & Templates > select style > Add Template
    Title - block_hof
    Template code -

    HTML Code:
    کد:
    <li> <div class="block smaller"> <div class="blocksubhead"> <a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a> <span class="blocktitle">{vb:raw blockinfo.title}</span> </div> <div id="block_html_{vb:raw blockinfo.blockid}" class="blockbody floatcontainer restore">         {vb:raw content}         </div> </div> <div class="underblock"></div> </l
    i>
    I usually remove the atrocious PHP/HTML icons that appear beside widget and block headings.

    3) Cache Templates

    Plugins & Products > Add New Plugin > leave everything default except:
    Hook Location - cache_templates
    Title - Cache templates for Hall of Fame
    Plugin PHP code -
    PHP Code:
    PHP Code:
    $
    کد:
    cache
    کد:
    = array_merge((array)$cache,array( 
        'block_hof', 
        'vbcms_widget_execphp_hof' 
    ));  
    

    Plugin is Active - Yes

    4) Create a new Widget

    vBulletin CMS > Widgets > Create New Widget
    Widget Type - PHP Direct Execution
    Title - Hall of Fame
    SAVE

    5) Configure the Widget

    Now go to vBulletin CMS > Widgets > Hall of Fame > Configure
    Change the Template Name to -
    vbcms_widget_execphp_hof
    Add the following code
    کد:
       
    
    $member_count = 8; ob_start(); require_once('./includes/functions_user.php'); require_once('./includes/functions_bigthree.php'); $ignore_condition = '1=1'; if (strlen($vbulletin->options['xperience_ignore_users']) > 0) { $ignore_condition .= " AND u.userid NOT IN(".$vbulletin->options['xperience_ignore_users'].") "; } // Get Top Members $topusers_get = vB::$db->query_read("SELECT u.userid AS userid, u.username AS username, u.usertitle AS title, x.points_xperience AS points FROM ".TABLE_PREFIX."user AS u LEFT JOIN ".TABLE_PREFIX."xperience_stats AS x ON x.userid=u.userid WHERE ".$ignore_condition." ORDER BY x.points_xperience DESC LIMIT $member_count" ); $show_top='<div class="connections_grid clearfix">'; while($topusers = vB::$db->fetch_array($topusers_get)) { $URL = fetch_avatar_url($topusers[userid]); $a_url = @$URL[0]; if (empty($a_url)) { $a_url = 'images/misc/unknown.gif'; } $show_top.='<div class="grid_item"><a href="member.php?u='.$topusers[userid].'"><img class="tpimg" src="'.$a_url.'" alt="'.$newuser[username].'"/><div class="name">'.$topusers[username].'<br />'.$topusers[title].'<br /><b>Points </b><span style="color:green;font-weight:bold">'.$topusers[points].'</span></div></a></div>'; } $show_top.='<div class="allrankings"><a rel="nofollow" href="xperience.php?go=ranking">Complete Hall of Fame Rankings</a></div></div>'; vB_Template::preRegister('vbcms_widget_execphp_hof', array('show_top' => $show_top)); ob_end_clean();


    You can change $member_count to as many members as you want to display.

    Save

    6) Add the widget to a proper layout.

    7) Create New Forum Block

    Forums & Moderators > Forum Blocks Manager > Add Block
    Block Type - Custom Html/PHP
    Title - Hall of Fame
    Content Type - PHP
    Content - Add this PHP Code

    کد:
     
    $member_count = 8; ob_start(); require_once('./includes/functions_user.php'); require_once('./includes/functions_bigthree.php'); $ignore_condition = '1=1'; if (strlen($vbulletin->options['xperience_ignore_users']) > 0) { $ignore_condition .= " AND u.userid NOT IN(".$vbulletin->options['xperience_ignore_users'].") "; } // Get Top Members $topusers_get = vB::$db->query_read("SELECT u.userid AS userid, u.username AS username, u.usertitle AS title, x.points_xperience AS points FROM ".TABLE_PREFIX."user AS u LEFT JOIN ".TABLE_PREFIX."xperience_stats AS x ON x.userid=u.userid WHERE ".$ignore_condition." ORDER BY x.points_xperience DESC LIMIT $member_count" ); $show_top='<div class="connections_grid clearfix">'; while($topusers = vB::$db->fetch_array($topusers_get)) { $URL = fetch_avatar_url($topusers[userid]); $a_url = @$URL[0]; if (empty($a_url)) { $a_url = 'images/misc/unknown.gif'; } $show_top.='<div class="grid_item"><a href="member.php?u='.$topusers[userid].'"><img class="tpimg" src="'.$a_url.'" alt="'.$newuser[username].'"/><div class="name">'.$topusers[username].'<br />'.$topusers[title].'<br /><b>Points </b><span style="color:green;font-weight:bold">'.$topusers[points].'</span></div></a></div>'; } $show_top.='<div class="allrankings"><a href="xperience.php?go=ranking">Complete Hall of Fame Rankings</a></div></div>'; $output = $show_top; ob_end_clean();

    Again, You can change $member_count to as many members as you want to display.

    Change template to use block_hof
    Save
    Save a proper Display Order

    Of course, I use both CMS Widget and Forum block, you may use either only one.

    VBAdvanced CMPS Module is attached. Thanks to DS MrSinister who provided this.

    Working Demo can be seen on my site : Oracle Forums Community. Screen shots not attached as don't want to show my member's avatar's here.

    Hope someone uses this... lol...

    کاربر مقابل از AliBother بابت این پست مفید تشکر کرده است:


  4. Top | #3
    کاربر سایت

    تاریخ عضویت
    Nov 2010
    ورژن ویبولتین
    4.0.4
    نوشته ها
    16
    مورد پسند
    7 بار
    اطلاعات
    میزان امتیاز
    0

    پیش فرض

    ممنون مدیر محترم
    ویرایش توسط kovach : 2012/02/29 در ساعت 02:24 AM

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

کلمات کلیدی این موضوع

علاقه مندی ها (Bookmarks)

علاقه مندی ها (Bookmarks)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •