vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Cutom Field on Custom Page?? (https://vborg.vbsupport.ru/showthread.php?t=216711)

cono1717 06-24-2009 12:03 PM

Quote:

// ****** TABLE PREFIX ******
// Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = '';
Nope, no prefix...

cono1717 06-25-2009 12:31 PM

Sorry for the bump, the help has been great so far though!

Dismounted 06-25-2009 01:16 PM

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
"
); 


cono1717 06-25-2009 01:26 PM

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.

Cryo 06-25-2009 06:10 PM

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.

Dismounted 06-26-2009 06:22 AM

You should also quote the array key inside a template conditional.
PHP Code:

<if condition="$auinfo['field7'] == 'I do not have a package'"


cono1717 06-26-2009 12:27 PM

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;



cono1717 06-27-2009 12:49 PM

Bump

anyone please??

cono1717 06-28-2009 01:55 PM

Sorry for another bump but I really need help on this I am at wits end...

Cryo 06-28-2009 10:16 PM

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.


All times are GMT. The time now is 01:36 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.01235 seconds
  • Memory Usage 1,764KB
  • 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_html_printable
  • (8)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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