PDA

View Full Version : help with vb3 mod ....database problems


teksigns
04-03-2004, 04:03 PM
i have a small script that i wrote.....

the purpose : to allow my moderators to turn on and off
a banner on my main page .......


im using a phrase named livechat ......
and a conditional on the main page checking to see
if livechat = on and if so show banner.

works fine if i change it from the phrase manager .
however if i change the value of livechat with this .


$text="off";
$query = "UPDATE phrase SET text = \"$text\" WHERE varname = 'livechat'";
$result= mysql_query($query) or die ("$admtext[cannotexecutequery]: $query");


i can check with phpMyAdmin and indeed the value changes from on to off....
and i can change back by just changing the value of $text......

however the conditional im using on the main page does not see the change unless i use the phrase manager to do so .....

what is going on ........

Boofo
04-03-2004, 04:25 PM
What is the conditional you are using that is not working?

teksigns
04-07-2004, 05:30 PM
What is the conditional you are using that is not working?


here it is :

<if condition="($vbphrase[livechat]!=off)">
<table align="center" border="1" cellspacing="0" width="60%" bordercolor="red" bordercolordark="red" bordercolorlight="red">
<tr>
<td width="965">
<p align="center"><b>$vbphrase[banner_text]</b></p>
</td>
</tr>
</table><br>
</if>



it works fine ... on and off as long as i make the change from within the
phrase manager in the admincp .....


but i need my moderators to be able to change it .


dont make since why it dont work if i change it directly in the database.

teksigns
04-07-2004, 05:33 PM
Jake Bunce - vBulletin Team told me this at vbulletin.com.

I'm not sure exactly what's wrong, but the problem is probably related to your directly updating the phrase with a query. Many vBulletin systems (the template system, for example) use data structures that need rebuilding after their information is updated. The phrase structure probably needs to be rebuilt.

Because this involves custom code I recommend you post on www.vbulletin.org for help.



anyone have any ideas ?