vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Yet Another Awards System [1.2.1] (https://vborg.vbsupport.ru/showthread.php?t=78934)

Lionel 04-14-2005 04:22 PM

Quote:

Originally Posted by mtha
Basically, you need to make changes for some new functions to work.

File changed in this version:

/admincp/index.php => add link to awards system settings
member.php
showthread.php => limit awards to display, and show link in postbit
showpost.php => limit awards to display, and show link in postbit
announcement.php => limit awards to display, and show link in postbit
private.php => limit awards to display, and show link in postbit
memberlist.php => NEW, show award in Memberlist
/include/functions_online.php => NEW, show location in WhoisOnline

Templates changed in this version:

MEMBERINFO
postbit => show # of awards and link to profile
postbit_legacy => show # of awards and link to profile
memberlist => NEW, show award in memberlist
memberlist_resultsbit => NEW, show award in memberlist

are you sure you put upgrade files. Those instructions included were alreay done.

mtha 04-14-2005 04:53 PM

Quote:

Originally Posted by TTG
Code:

$globaltemplates = array(
                'awards_bit'
);

Yep :) .. still only showing the additional column.

agrr, my bad. I forgot to change the "Find in File /private.php" with the correct file name in two spots :(

do the next changes that was named private.php next to it too. and the one bellow that for functions_online.php

or you can download the instruction again.

sorry.,


Quote:

Looking forward to installing the update, since I now need to incorporate a nomination and voting system for the Member of the Month awards I have created ... thanks again for this hack, I will be donating very soon!
what's your "voting system"? sounds like fun :D


Quote:

(Gotta get through tax day tomorrow, first.)
agrrr, I forgot this too :(, have to do it today :(

p h o e n i x x 04-14-2005 05:18 PM

Mine will not show up in my postbit template. :-(
Help.

- PX

mtha 04-14-2005 07:11 PM

Quote:

Originally Posted by p h o e n i x x
Mine will not show up in my postbit template. :-(
Help.

- PX

make sure you have the following:

Pre-requirement:
1. You have some awards in stock
2. The member you are looking at, has some award
3. You have the option Display in postbit = YES
4. Maximum Awards Displayed > 0

make sure you did the follwing changes:

Code:

<edit file>
showthread.php
</edit file>

<search for>
        'pollresult',
</search for>

<replace>
        'pollresult',
        'awards_bit'
</replace>

<search for>
        if (!($forumperms & CANGETATTACHMENT))
        {
                $vboptions['viewattachedimages'] = 0;
                $vboptions['attachthumbs'] = 0;
        }

        $postcount = ($pagenumber - 1 ) * $perpage;
</search for>

<add before>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        if ($vboptions['aw_postbit'])
        {
                // Obtain list of awards for current user
                $alluserawards =  $DB_site->query("
                        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 $postids
                        GROUP BY au.issue_id
                ");
                while( $ua = $DB_site->fetch_array($alluserawards))
                {
                        $userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
                }
                $DB_site->free_result($alluserawards);
        }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']
</add before>

<search for>
        while ($post = $DB_site->fetch_array($posts))
        {
</search for>

<add after>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        $post['userawards'] = '';
        $post['showuserawards'] = false;
        if ($vboptions['aw_postbit'])
        {
                        if (is_array($userawardscache[$post[userid]]))
                        {
                                $aw_i = 0;
                            $post['num_awards'] = count($userawardscache[$post[userid]]);
                            foreach($userawardscache[$post['userid']] AS $award_id => $award)
                                {
                                        $aw_i++;
                                    if ($aw_i <= $vboptions['aw_display_limit'])
                                        {
                                        eval('$post[userawards] .= "' . fetch_template('awards_bit') . '";');
                                        }
                                }
                                $post['showuserawards'] = true;
                        }
                }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']

</add after>

<search for>
        // re-initialise the $postarray variable
        $postarray = array();
        while ($post = $DB_site->fetch_array($cacheposts))
        {
</search for>

<replace>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        if ($vboptions['aw_postbit'])
        {
                // Obtain list of awards for current user
                $alluserawards =  $DB_site->query("
                        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 post.postid IN (" . $cache_postids . ")
                        GROUP BY au.issue_id
                ");
                while( $ua = $DB_site->fetch_array($alluserawards))
                {
                        $userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
                }
                $DB_site->free_result($alluserawards);
        }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']

        // re-initialise the $postarray variable
        $postarray = array();
        while ($post = $DB_site->fetch_array($cacheposts))
        {

// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        $post['userawards'] = '';
        $post['showuserawards'] = false;
        if ($vboptions['aw_postbit'])
        {
                if (is_array($userawardscache[$post[userid]]))
                {
                        $aw_i = 0;
                        $post['num_awards'] = count($userawardscache[$post[userid]]);
                        foreach($userawardscache[$post['userid']] AS $award_id => $award)
                        {
                                $aw_i++;
                                if ($aw_i <= $vboptions['aw_display_limit'])
                                {
                                    eval('$post[userawards] .= "' . fetch_template('awards_bit') . '";');
                                }
                        }
                        $post['showuserawards'] = true;
                }
        }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']
</replace>

Make sure you did edit postbit (or postbit_legacy) template on the current using style.

HTML Code:

<!-- show awards -->
<if condition="$post[showuserawards]">
<div>
$post[userawards]
<br>
$vbphrase[total_awards]: $post[num_awards] (<a href="member.php?$session[sessionurl]u=$post[userid]#award">$vbphrase[more_awards] ...</a>)
</div>
</if>
<!-- /show awards -->

That's all what you need to do to show awards in "showthread", edit other files for other pages.

Hope you can get something out of it. It's hard to help if you provide me NO information, except saying "It will not show up"

TTG 04-14-2005 08:23 PM

Quote:

Originally Posted by mtha
agrr, my bad. I forgot to change the "Find in File /private.php" with the correct file name in two spots :(

do the next changes that was named private.php next to it too. and the one bellow that for functions_online.php

or you can download the instruction again.

sorry.,
(

Thanks mtha ... that fixed the problem .. thought I was going code crazy

mtha 04-14-2005 10:38 PM

Quote:

Originally Posted by TTG

Thanks mtha ... that fixed the problem .. thought I was going code crazy

I still suggest you to install BoardMod and let it edit files automatically. it's quick, and it's easy. it also has option to show you to edit step by step too. I create the "file edit" mod in that program, before ... making the html instructions.

RED_LINE 04-15-2005 12:52 PM

nice hack

i have this error

Database error in vBulletin 3.0.7:

Invalid SQL:
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
GROUP BY au.issue_id
ORDER BY au.issue_time

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY au.issue_id
ORDER BY a

mysql error number: 1064

Date: Friday 15th of April 2005 09:50:46 AM
Script: http://www.xxx.net/vb/showthread.php?p=388449
Referer: http://www.xxx.net/vb/
Username: RED_LINE
IP Address: 62.150.45.128

.....
how can i fixed this error?

Regards,

mtha 04-15-2005 01:19 PM

Quote:

Originally Posted by RED_LINE
nice hack

i have this error

Database error in vBulletin 3.0.7:

Invalid SQL:
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
GROUP BY au.issue_id
ORDER BY au.issue_time

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY au.issue_id
ORDER BY a

mysql error number: 1064

Date: Friday 15th of April 2005 09:50:46 AM
Script: http://www.xxx.net/vb/showthread.php?p=388449
Referer: http://www.xxx.net/vb/
Username: RED_LINE
IP Address: 62.150.45.128

.....
how can i fixed this error?

Regards,

is that when you showthread? are you sure you did change the file correctly?

I DONOT have anything in showthread.php that ORDER BY au.issue_time, Could you check the awards_install_file.html and make the correct changes to the file? if the errors still there, send me the showthread.php that you have.

here's what you need to change in showthread.php:


Code:


<edit file>
showthread.php
</edit file>

<search for>
        'pollresult',
</search for>

<replace>
        'pollresult',
        'awards_bit'
</replace>

<search for>
        if (!($forumperms & CANGETATTACHMENT))
        {
                $vboptions['viewattachedimages'] = 0;
                $vboptions['attachthumbs'] = 0;
        }

        $postcount = ($pagenumber - 1 ) * $perpage;
</search for>

<add before>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        if ($vboptions['aw_postbit'])
        {
                // Obtain list of awards for current user
                $alluserawards =  $DB_site->query("
                        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 $postids
                        GROUP BY au.issue_id
                ");
                while( $ua = $DB_site->fetch_array($alluserawards))
                {
                        $userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
                }
                $DB_site->free_result($alluserawards);
        }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']
</add before>

<search for>
        while ($post = $DB_site->fetch_array($posts))
        {
</search for>

<add after>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        $post['userawards'] = '';
        $post['showuserawards'] = false;
        if ($vboptions['aw_postbit'])
        {
                        if (is_array($userawardscache[$post[userid]]))
                        {
                                $aw_i = 0;
                            $post['num_awards'] = count($userawardscache[$post[userid]]);
                            foreach($userawardscache[$post['userid']] AS $award_id => $award)
                                {
                                        $aw_i++;
                                    if ($aw_i <= $vboptions['aw_display_limit'])
                                        {
                                        eval('$post[userawards] .= "' . fetch_template('awards_bit') . '";');
                                        }
                                }
                                $post['showuserawards'] = true;
                        }
                }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']

</add after>

<search for>
        // re-initialise the $postarray variable
        $postarray = array();
        while ($post = $DB_site->fetch_array($cacheposts))
        {
</search for>

<replace>
// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        if ($vboptions['aw_postbit'])
        {
                // Obtain list of awards for current user
                $alluserawards =  $DB_site->query("
                        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 post.postid IN (" . $cache_postids . ")
                        GROUP BY au.issue_id
                ");
                while( $ua = $DB_site->fetch_array($alluserawards))
                {
                        $userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
                }
                $DB_site->free_result($alluserawards);
        }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']

        // re-initialise the $postarray variable
        $postarray = array();
        while ($post = $DB_site->fetch_array($cacheposts))
        {

// [START HACK='Yet Another Award System' AUTHOR='HacNho']
        $post['userawards'] = '';
        $post['showuserawards'] = false;
        if ($vboptions['aw_postbit'])
        {
                if (is_array($userawardscache[$post[userid]]))
                {
                        $aw_i = 0;
                        $post['num_awards'] = count($userawardscache[$post[userid]]);
                        foreach($userawardscache[$post['userid']] AS $award_id => $award)
                        {
                                $aw_i++;
                                if ($aw_i <= $vboptions['aw_display_limit'])
                                {
                                    eval('$post[userawards] .= "' . fetch_template('awards_bit') . '";');
                                }
                        }
                        $post['showuserawards'] = true;
                }
        }
// [END HACK='Yet Another Award System' AUTHOR='HacNho']
</replace>


RED_LINE 04-15-2005 07:40 PM

hello

yes im sure about change the file correctly

the error somtimes apear not alaways :rolleyes:

can you check showthread.php plz

Regards,

Marco van Herwaarden 04-15-2005 07:56 PM

Red Line

Please remove that file immediate. It is against your license agreement and against our forum rules to post vB files.


All times are GMT. The time now is 08:14 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.02223 seconds
  • Memory Usage 1,834KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (8)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