Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 06-24-2009, 12:03 PM
cono1717 cono1717 is offline
 
Join Date: Sep 2008
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
// ****** TABLE PREFIX ******
// Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = '';
Nope, no prefix...
Reply With Quote
  #12  
Old 06-25-2009, 12:31 PM
cono1717 cono1717 is offline
 
Join Date: Sep 2008
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for the bump, the help has been great so far though!
Reply With Quote
  #13  
Old 06-25-2009, 01:16 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:
PHP Code:
$getusers $vbulletin->db->query("
    SELECT COUNT(p.postid) AS total, p.userid, u.username, u.joindate, f.field7
    FROM " 
TABLE_PREFIX "post AS p
    LEFT JOIN " 
TABLE_PREFIX "user AS u USING (userid)
    LEFT JOIN " 
TABLE_PREFIX "userfield AS f USING (userid)
    WHERE p.dateline > 
$cutoffstart
        AND p.dateline < 
$cutoffend
    GROUP BY userid
    ORDER BY total DESC
    LIMIT 
$limit
"
); 
Reply With Quote
  #14  
Old 06-25-2009, 01:26 PM
cono1717 cono1717 is offline
 
Join Date: Sep 2008
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HUZZAH it works, just another quick question though, how do I make a statement if a value is less than something.

So say
HTML Code:
<if conditional=$auinfo[total] IS LESS THAN $auinfo[posts]>
Less than stuff here
<else />
Greater than stuff here
</if>
ALSO what is wrong with this template?

HTML Code:
<td class="alt2">
<if condition="$auinfo[field7] == I do not have a package">
N/A
</if>
<if condition="$auinfo[field7] == SHARED A">
One time 5 posts
</if>
<if condition="$auinfo[field7] == SHARED B">
15 P/M
</if>
<if condition="$auinfo[field7] == SHARED C">
20 P/M
</if>
<if condition="$auinfo[field7] == SHARED D">
20 P/M (VIP ONLY)
</if>
<if condition="$auinfo[field7] == RESELLER A">
25 P/M
</if>
<if condition="$auinfo[field7] == RESELLER B">
75 P/M
</if>
<if condition="$auinfo[field7] == RESELLER C">
200 P/M
</if>
<if condition="$auinfo[field7] == RESELLER D">
200 P/M (VIP ONLY)
</if>
<if condition="$auinfo[field7] == Custom/Other">
Consult Staff Area
</if>
</td>
The error is The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected T_DO in /home/geekstep/public_html/includes/adminfunctions_template.php(3938) : eval()'d code on line 9

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.
Reply With Quote
  #15  
Old 06-25-2009, 06:10 PM
Cryo Cryo is offline
 
Join Date: Dec 2003
Location: Buffalo, NY
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Less than...

PHP Code:
<if conditional="$auinfo[total] < $auinfo[posts]">
Less than stuff here
<else />
Greater than stuff here
</if> 
... should work. As far as your parsing errors it's most likely due to you not encapsulating the variables. For example,

PHP Code:
<if condition="$auinfo[field7] == I do not have a package"
should be...

PHP Code:
<if condition="$auinfo[field7] == 'I do not have a package'"
Note the single quotes around the value.
Reply With Quote
  #16  
Old 06-26-2009, 06:22 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should also quote the array key inside a template conditional.
PHP Code:
<if condition="$auinfo['field7'] == 'I do not have a package'"
Reply With Quote
  #17  
Old 06-26-2009, 12:27 PM
cono1717 cono1717 is offline
 
Join Date: Sep 2008
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now a new problem arises. I am trying to make a variable changeable depending on the users selection so that if their post count does not meet the requirements staff are noted.

Basically I want to make the following

HTML Code:
<if condition="$auinfo[field7] <(is less than) $conditional">
Post count not met
</if>
And obviously there is a else statement on there if they do meet it,

however the code I am using in my PHP file does not display the stuff set when I add $conditional into my template here is the code

PHP Code:
if ($auinfo['field7'] == "I don\'t have a package")
{
    
$conditional 0;
} else if (
$auinfo['field7'] == "SHARED A")
{
    
$conditional 5;
} else if (
$auinfo['field7'] == "SHARED B")
{
    
$conditional 15;
} else if (
$auinfo['field7'] == "SHARED C")
{
    
$conditional 20;
} else if (
$auinfo['field7'] == "SHARED D")
{
    
$conditional 20;
} else if (
$auinfo['field7'] == "RESELLER A")
{
    
$conditional 25;
}
 else if (
$auinfo['field7'] == "RESELLER B")
{
    
$conditional 75;
} else if (
$auinfo['field7'] == "RESELLER C")
{
    
$conditional 200;
}
 else if (
$auinfo['field7'] == "RESELLER D")
{
    
$conditional 200;
} else if (
$auinfo['field7'] == "Custom/Other")
{
    
$conditional 00;

Reply With Quote
  #18  
Old 06-27-2009, 12:49 PM
cono1717 cono1717 is offline
 
Join Date: Sep 2008
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump

anyone please??
Reply With Quote
  #19  
Old 06-28-2009, 01:55 PM
cono1717 cono1717 is offline
 
Join Date: Sep 2008
Posts: 165
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for another bump but I really need help on this I am at wits end...
Reply With Quote
  #20  
Old 06-28-2009, 10:16 PM
Cryo Cryo is offline
 
Join Date: Dec 2003
Location: Buffalo, NY
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change...

PHP Code:
$conditional = (whatever); 
... to...

PHP Code:
$this->post[conditional
Then reference $post[conditional] in the template.

Edit: To clarify, this is what you would use if you're trying to utilize this in the postbit template.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:22 AM.


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.07037 seconds
  • Memory Usage 2,297KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_html
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete