The Arcive of vBulletin Modifications Site. |
|
Problem calling $count[threads] variable Details »»
|
|||||||||||||||||||||||||
im working on a little hack, however im having a problem calling a variable in a template. here is the call:
$count[threads] new thread$pluralthread If a new thread(s) have been made, the # will show no problem - the plural variable is working fine also. However, if no threads have been made, instead of showing 'No' like i think i specified below, nothing is showing up. Heres the code where they are defined: Code:
$newthreads = '';
if ( $activenewthread )
{
if ( $dothreads = $DB_site->query_first("
SELECT COUNT(*) AS total
FROM thread
WHERE $iforumperms AND dateline>$bbuserinfo[lastvisit]
") and !empty( $dothreads['total'] ) )
{
$count['threads'] = number_format( $dothreads['total'] );
$count['threads'] = iif ( $count['threads']!=0 , $count['threads'] , 'No' );
$pluralthread = iif ( $count['threads']!=1 , 's' , '' );
}
}
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
i think you would get type mismatches here try this code:
PHP Code:
|
|
#3
|
|||
|
|||
|
nope..still not showing the 'No'
this is where im calling it: Code:
<img src="/bullet.gif">$count[threads] new thread$pluralthread<br /> |
|
#4
|
||||
|
||||
|
try this code then:
PHP Code:
|
|
#5
|
|||
|
|||
|
that was it! thanks much..i really appreciate the help
|
|
#6
|
||||
|
||||
![]() no problem, you're welcome
|
![]() |
|
|