vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Major Additions - Yet Another Awards System (https://vborg.vbsupport.ru/showthread.php?t=232684)

augrunt 01-25-2011 12:01 AM

I need some help...

When I give an award to a user via modcp. I get the following error

Code:

Warning: mysql_insert_id() [function.mysql-insert-id]: A link to the server could not be established in [path]/modcp/award.php on line 381
and when I grant it via admincp. I get the following error

Code:

Warning: mysql_insert_id() [function.mysql-insert-id]: A link to the server could not be established in [path]/admincp/award.php on line 595
They are quite obviously related. I haven't had time to poke around the code, has anyone else encountered this?

Mobo 01-26-2011 05:51 AM

Quote:

Originally Posted by sadiq6210 (Post 2148842)
UPDATE FOR: 4.0.8 - 4.1.1
(TAKE BACKUP BEFORE ANY REPLACE)

1- Find the template (memberinfo_block_myawards) and replace it all
Code:

<div id="view-myawards" class="<vb:if condition="$selected_tab == 'myawards'">selected_view_section<vb:else />view_section</vb:if>">
<div>

<div class="blocksubhead subsectionhead userprof_headers userprof_headers_border">
{vb:rawphrase award_showcase} - {vb:raw $block_data[num]} {vb:rawphrase awards} <vb:if condition="$vboptions[aw_points]"> - {vb:raw $block_data[total_points]} {vb:rawphrase points}</vb:if>
</div>

<div class="blockbody">
<table width="100%">
<tr align="center">
        <vb:if condition="$vboptions[aw_showicon]"><th class="blocksubhead" nowrap="nowrap">{vb:rawphrase award_icon}</th></vb:if>
        <vb:if condition="$vboptions[aw_showimage]"><th class="blocksubhead" nowrap="nowrap">{vb:rawphrase award_image}</th></vb:if>
        <th class="blocksubhead" width="100%">{vb:rawphrase award_description}</th>
</tr>
{vb:raw $block_data[myawards]}
</table>
</div>
</div>
</div>



2- From plugin manager:
Find (YAAS in Member Profile - Profile) >> EDIT >> Replace it all
Code:

$blocklist['myawards'] = array(
        'class' => 'MyAwards',
        'title' => $vbphrase['my_awards'],
        'options' => array(
                'pagenumber' => $vbulletin->GPC['pagenumber']
        ),
        'hook_location' => 'profile_tabs_last',
        'wrap' => false
);

require_once('./global.php');
global $vbulletin; 
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

class vB_ProfileBlock_MyAwards extends vB_ProfileBlock
{
    var $template_name = 'memberinfo_block_myawards';

    function confirm_empty_wrap()
    {
        return false;
    }

    function confirm_display()
    {
        return ($this->block_data['myawards'] != '');
    }

    function prepare_output($id = '', $options = array())
    {
        global $show, $vbphrase, $stylevar, $vbcollapse, $bgclass, $vbulletin;
       
        require_once(DIR . '/includes/class_bbcode.php');
        $bbcode_parser =& new vB_BbCodeParser($this->registry, fetch_tag_list());

               
                $result = $this->registry->db->query_read('
            SELECT
                *
            FROM
            ' . TABLE_PREFIX . 'award_user AS award_user
                LEFT JOIN ' . TABLE_PREFIX . 'award AS award USING (award_id)
            WHERE
                award_user.userid = ' . $this->profile->userinfo['userid'] . '
                AND award.award_active = "1"
            ORDER BY
              '.$vbulletin->options['aw_awardorder'].'
        ');
       
                                if (($vbulletin->options['aw_points']) AND ($this->profile->userinfo['userid']))
                                {
                                        $userpoints = $this->registry->db->query_read('
                                                SELECT a.*, au.*, SUM(award_pointvalue) AS TotalPoints
                                                FROM ' . TABLE_PREFIX . 'award a, ' . TABLE_PREFIX . 'award_user au
                                                WHERE (au.userid = '.$this->profile->userinfo['userid'].') AND (a.award_id=au.award_id) AND (a.award_active = "1")
                                                GROUP BY au.userid
                                        ');
                               
                                        while ($array = $this->registry->db->fetch_array($userpoints))
                                                {
                                                $this->block_data['total_points'] = $array['TotalPoints'];
                                                } 
                                }
               
        $num = $this->block_data['num'] = $this->registry->db->num_rows($result);
       
        $this->block_data['myawards'] = '';
       
        if ($num > 0)
        {
            // Display Awards
            while ($award = $this->registry->db->fetch_array($result))
            {
                exec_switch_bg();
               
                $award['award_desc'] = $bbcode_parser->parse($award['award_desc']);
                $award['issue_reason'] = $bbcode_parser->parse($award['issue_reason']);
               
                $award_issue_date = vbdate($this->registry->options['dateformat'], $award['issue_time'], true);
                $award_issue_time = vbdate($this->registry->options['timeformat'], $award['issue_time']);
               
                //- VB3 -// eval('$this->block_data[\'myawards\'] .= "' . fetch_template('awards_userawards_bit') . '";');
                                //- BEGIN VB4 -//
                                $templater = vB_Template::create('awards_userawards_bit');
                                        $templater->register('award', $award);
                                        $templater->register('award_issue_date', $award_issue_date);
                                        $templater->register('award_issue_time', $award_issue_time);
                                $this->block_data['myawards'] .= $templater->render();
                                //- END VB4 -//
            }
        }
    }
}


3- From same place (Plugin Manager) find (YAAS - Profile Tab) and disactive it.


This helps out alot with the look in the profile page. However, the tab still has some display issues:

1. There is an "inner tab" showing inside the normal tab (mine is renamed "My Medals")
2. When you click on the My Medals tab, the high light color is wrong.

Mobo 01-26-2011 07:53 AM

Is there a way to control what order the awards display in the postbit? I would like for them to display in the same order in the postbit as they do in the Awards List page.

I have my ordered from Highest to Lowest achievement for my site and would like for them to show that way from left to right in the postbit.

sadiq6210 01-26-2011 10:53 AM

Quote:

Originally Posted by Mobo (Post 2154745)
This helps out alot with the look in the profile page. However, the tab still has some display issues:

1. There is an "inner tab" showing inside the normal tab (mine is renamed "My Medals")
2. When you click on the My Medals tab, the high light color is wrong.

At the end of the template (awards_css.css)
Add this:

Code:

#myawards-tab, #myawards-tab a:hover {
background-color:transparent;
border:medium none;
display:inline;
height:25px;
margin:0;
padding:0;
text-align:center;
}

a#myawards-tab:hover {
background:none repeat scroll 0 0 transparent;
}


Mobo 01-26-2011 11:27 AM

Yep, that fixed it. Thank you!

Mobo 01-26-2011 11:29 AM

Okay, it does fix it, but it gives this error:

Code:

The following error occurred when attempting to evaluate this template:
Unclosed Curly Brace Expression
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


SpikedRocker 01-26-2011 10:29 PM

Mobo, check to make sure you copied it right. The way to get that error is to have } missing. Check each conditional to make sure they are closed with }.

I don't see a problem with sadiq's css he placed on here.

Also, I'd like to bump my problem:
Quote:

Fatal error: Cannot redeclare construct_depth_mark() (previously declared in /home/content/s/p/i/spikedrocker/html/surisite/tns2.0/forum/awards.php:98) in /home/content/s/p/i/spikedrocker/html/surisite/tns2.0/forum/includes/adminfunctions.php on line 1906

sadiq6210 01-27-2011 05:40 AM

Quote:

Originally Posted by Mobo (Post 2154816)
Okay, it does fix it, but it gives this error:

Code:

The following error occurred when attempting to evaluate this template:
Unclosed Curly Brace Expression
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Replace all template (awards_css.css) with:

Code:

/* Begin Style 1 Fieldset Formatting*/

fieldset {
  padding-left: 4px;
  border: 1px solid rgb(15, 16, 19);
  }

legend {

 }

/* End Style 1 Fieldset Formatting*/

DIV.awards_postbit_style2 {
 PADDING-LEFT: 2px;
}

DIV.awards_postbit_style3 {
 PADDING-LEFT: 2px;
}

/* Begin Postbit Custom Formatting*/
DIV.awards_postbit_customcss {
 PADDING-LEFT: 2px;
}

DIV.awards_showcase_headtext {

}

DIV.awards_showcase_awarddisplay {

}

DIV.awards_showcase_infodisplay {

}

#myawards-tab, #myawards-tab a:hover {
background-color:transparent;
border:medium none;
display:inline;
height:25px;
margin:0;
padding:0;
text-align:center;
}

a#myawards-tab:hover {
background:none repeat scroll 0 0 transparent;
}

/* End PostbitCustom Formatting*/


sadiq6210 01-27-2011 05:40 AM

Quote:

Originally Posted by SpikedRocker (Post 2155068)
Mobo, check to make sure you copied it right. The way to get that error is to have } missing. Check each conditional to make sure they are closed with }.

I don't see a problem with sadiq's css he placed on here.

Also, I'd like to bump my problem:

When you get this error and where?

SpikedRocker 01-27-2011 12:20 PM

The error is a constant error I get when anyone views the awards.php

We aren't too sure what we changed and what caused it. I've tried downloading and reuploading and updating the entire addon but this error sticks.


All times are GMT. The time now is 04:37 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.02143 seconds
  • Memory Usage 1,778KB
  • 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
  • (8)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)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