vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - Yet Another Awards System 2.1.4 (https://vborg.vbsupport.ru/showthread.php?t=142487)

SVTCobraLTD 10-02-2008 04:45 PM

Quote:

Originally Posted by letsjoy (Post 1635762)
Please launch for 3.7+...we will be thank ful :)

One page back had this... https://vborg.vbsupport.ru/showthread.php?p=1594424

saviola8x 10-10-2008 10:34 AM

Mark as Installed.

Jelmertjee 10-31-2008 04:06 PM

I wasn't really satisfied with the postbit awards position so decided to add one manually myself, it looks like this:

https://vborg.vbsupport.ru/external/2008/10/1.gif

How can you do it?

1. open the postbit template and add a new hook where you want the awards, in my case it was the <td> between the left and right of the userinfo, for me it looked like this:

Code:

<td width="100%">$template_hook[postbit_userinfo_center]</td>
Such a hook is just an identifier for all sorts of plugins so they can add stuff to templates automatically, now we need to tell our plugin to use this new hook.

2. in your admincp go into plugins, under awards open YAAS in Posbit

Now replace:
Code:

                        {
                                eval('$template_hook[\'postbit_userinfo_right\'] .= "' . fetch_template('awards_postbit_display') . '";');
                        }

with:
Code:

                        {
                                eval('$template_hook[\'postbit_userinfo_center\'] .= "' . fetch_template('awards_postbit_display') . '";');
                        }

I'm assuming you're using the default position in your award settings (admincp), we're basically changing it to the hook we've just made in the template, that's all.

I also added some custom css to better style this, first open the template awards_postbit_display, I've changed it like this, adding a div with a class around it to get some css control:

HTML Code:

<!-- show awards -->
<if condition="$post[showuserawards]">
<div class="postbit_awards">
<fieldset><legend><a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[award_showcase]</a></legend>
<div>
$post[userawards]
<br>
<a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[total_awards]</a>: $post[num_awards]
</div>
</fieldset>
</div>
</if>
<!-- /show awards -->

Then add this bit of css to your custom css definitions:
HTML Code:

.postbit_awards{float: left}
of course you can adjust this further to your liking, this makes it float to the left instead of the full width, you could also use float:right instead.

This looks a lot better and saves space, hope you like it.

TheLastSuperman 10-31-2008 07:12 PM

Quote:

Originally Posted by Jelmertjee (Post 1656706)
I wasn't really satisfied with the postbit awards position so decided to add one manually myself, it looks like this:

http://enjoycg.com/images/awards_postbit.gif

How can you do it?

1. open the postbit template and add a new hook where you want the awards, in my case it was the <td> between the left and right of the userinfo, for me it looked like this:

Code:

<td width="100%">$template_hook[postbit_userinfo_center]</td>
Such a hook is just an identifier for all sorts of plugins so they can add stuff to templates automatically, now we need to tell our plugin to use this new hook.

2. in your admincp go into plugins, under awards open YAAS in Posbit

Now replace:
Code:

                        {
                                eval('$template_hook[\'postbit_userinfo_right\'] .= "' . fetch_template('awards_postbit_display') . '";');
                        }

with:
Code:

                        {
                                eval('$template_hook[\'postbit_userinfo_center\'] .= "' . fetch_template('awards_postbit_display') . '";');
                        }

I'm assuming you're using the default position in your award settings (admincp), we're basically changing it to the hook we've just made in the template, that's all.

I also added some custom css to better style this, first open the template awards_postbit_display, I've changed it like this, adding a div with a class around it to get some css control:

HTML Code:

<!-- show awards -->
<if condition="$post[showuserawards]">
<div class="postbit_awards">
<fieldset><legend><a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[award_showcase]</a></legend>
<div>
$post[userawards]
<br>
<a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[total_awards]</a>: $post[num_awards]
</div>
</fieldset>
</div>
</if>
<!-- /show awards -->

Then add this bit of css to your custom css definitions:
HTML Code:

.postbit_awards{float: left}
of course you can adjust this further to your liking, this makes it float to the left instead of the full width, you could also use float:right instead.

This looks a lot better and saves space, hope you like it.

AND... you know you can remove the border and text and display just the image right :D

See here for a similar code reference --> https://vborg.vbsupport.ru/showpost....57&postcount=3

So basically the Rank or in this mods case.. Awards would be displayed just as the images themselves and between your guns image and your name!

TheLastSuperman 10-31-2008 07:13 PM

Quote:

Originally Posted by gamerfu (Post 1619590)
Make this suggestion for the YAAS 4.0. Very nice suggestion. I have this delima too. :o

Hmmmmm, nice suggestion.... I'll look into this for the Rank mod I support and get back to ya as I will add it into my Award Mod when I do!

bluesoul 11-09-2008 03:26 PM

Sorry for not perusing the entire thread but is there a simple way to remove either the icon or image column from being displayed? I don't really need both for what we're using it for.

EDIT: Got it, reading through the settings is pro.

SVTCobraLTD 11-16-2008 01:45 AM

On 3.6.11 I try and give an award but the keeps saying
Code:

Content Encoding Error       

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.       

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

    * Please contact the website owners to inform them of this problem.

when trying to access "http://sitename.com/forums/admincp/award.php?do=dogiveaward".

Any ideas? I have given away more than 20 awards without any problems. It happens both in firefox and IE.

home9000 01-02-2009 01:24 PM

Quote:

Originally Posted by Simetrical (Post 1292972)
This is a nice mod. Unfortunately, it crashed my site when this query was run repeatedly during a period of high load (23 times over, running between 78 and 208 seconds, as of just before I started killing them):
Code:

mysql> EXPLAIN SELECT a.*, au.*, post.userid, post.postid
    ->                        FROM post AS post
    ->                        INNER JOIN award_user AS au ON (au.userid=post.userid)
    ->                        INNER JOIN award AS a ON (a.award_id=au.award_id)
    ->                        WHERE 1=1
    ->
    ->
    ->                        GROUP BY au.issue_id
    ->                        ORDER BY au.issue_time DESC;
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
| id | select_type | table | type  | possible_keys | key    | key_len | ref                    | rows  | Extra                          |
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
|  1 | SIMPLE      | au    | ALL    | NULL          | NULL    | NULL    | NULL                    |  117 | Using temporary; Using filesort |
|  1 | SIMPLE      | a    | eq_ref | PRIMARY      | PRIMARY | 2      | totalwar_vb.au.award_id |    1 | Using where                    |
|  1 | SIMPLE      | post  | ref    | userid        | userid  | 4      | totalwar_vb.au.userid  | 25005 | Using where                    |
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
3 rows in set (0.00 sec)

While I'm no MySQL expert, it seems that this attempts to copy the entirety of the post table to a temporary table, in my case about 1.5 million rows. I've tracked the query down to the showthread_query hook:
PHP Code:

        // Obtain list of awards for current user
        
$alluserawards =  $db->query_read("
            SELECT a.*, au.*, post.userid, post.postid 
            FROM " 
TABLE_PREFIX "post AS post
            INNER JOIN " 
TABLE_PREFIX "award_user AS au ON (au.userid=post.userid)
            INNER JOIN " 
TABLE_PREFIX "award AS a ON (a.award_id=au.award_id)
            WHERE 1=1 
"
iif((!empty($ids)), "AND post.postid IN (0" $ids ")") ."
"
iif((!empty($cache_postids)), "AND post.postid IN (" $cache_postids ")") ."
            GROUP BY au.issue_id
            
$awardsdisplayorder
        "
);

        while( 
$ua $db->fetch_array($alluserawards))
        {
            
$userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
        }
        
$db->free_result($alluserawards); 

Apparently this fails to account for the possibility that $ids and $cache_postids are both empty. I have no idea why it would or would not be reasonable to account for that, because I don't know what either of those variables is, but at any rate, if they both are empty things are not very good. I've wrapped the whole thing in a conditional checking whether both are empty, just not setting anything if they both are. I'd appreciate any response.

I have the same problem any solution or workaround ?

home9000 01-03-2009 05:25 PM

Quote:

Originally Posted by Simetrical (Post 1292972)
This is a nice mod. Unfortunately, it crashed my site when this query was run repeatedly during a period of high load (23 times over, running between 78 and 208 seconds, as of just before I started killing them):
Code:

mysql> EXPLAIN SELECT a.*, au.*, post.userid, post.postid
    ->                        FROM post AS post
    ->                        INNER JOIN award_user AS au ON (au.userid=post.userid)
    ->                        INNER JOIN award AS a ON (a.award_id=au.award_id)
    ->                        WHERE 1=1
    ->
    ->
    ->                        GROUP BY au.issue_id
    ->                        ORDER BY au.issue_time DESC;
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
| id | select_type | table | type  | possible_keys | key    | key_len | ref                    | rows  | Extra                          |
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
|  1 | SIMPLE      | au    | ALL    | NULL          | NULL    | NULL    | NULL                    |  117 | Using temporary; Using filesort |
|  1 | SIMPLE      | a    | eq_ref | PRIMARY      | PRIMARY | 2      | totalwar_vb.au.award_id |    1 | Using where                    |
|  1 | SIMPLE      | post  | ref    | userid        | userid  | 4      | totalwar_vb.au.userid  | 25005 | Using where                    |
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
3 rows in set (0.00 sec)

While I'm no MySQL expert, it seems that this attempts to copy the entirety of the post table to a temporary table, in my case about 1.5 million rows. I've tracked the query down to the showthread_query hook:
PHP Code:

        // Obtain list of awards for current user
        
$alluserawards =  $db->query_read("
            SELECT a.*, au.*, post.userid, post.postid 
            FROM " 
TABLE_PREFIX "post AS post
            INNER JOIN " 
TABLE_PREFIX "award_user AS au ON (au.userid=post.userid)
            INNER JOIN " 
TABLE_PREFIX "award AS a ON (a.award_id=au.award_id)
            WHERE 1=1 
"
iif((!empty($ids)), "AND post.postid IN (0" $ids ")") ."
"
iif((!empty($cache_postids)), "AND post.postid IN (" $cache_postids ")") ."
            GROUP BY au.issue_id
            
$awardsdisplayorder
        "
);

        while( 
$ua $db->fetch_array($alluserawards))
        {
            
$userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
        }
        
$db->free_result($alluserawards); 

Apparently this fails to account for the possibility that $ids and $cache_postids are both empty. I have no idea why it would or would not be reasonable to account for that, because I don't know what either of those variables is, but at any rate, if they both are empty things are not very good. I've wrapped the whole thing in a conditional checking whether both are empty, just not setting anything if they both are. I'd appreciate any response.

I have to remove this hack because this issue
It's make my site down 10 time per day

I am looking to another hack

Thank for you all

Tarfandestan 01-03-2009 10:24 PM

Hi.
Im using this hack for my forum.
but when I give an award to one of users, it doesn't show in his/her posts.
and when I give an award to one of moderators, its correctly add to his/her posts.
what's wrong?


All times are GMT. The time now is 10:56 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02462 seconds
  • Memory Usage 1,833KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (4)bbcode_html_printable
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete