Quote:
Originally Posted by Lynne
I'll repeat... Please use the html/php tags. It is very difficult to read code when you don't use those. They are right here in the Quick Reply box - very easy to use. I don't care about your original code, I just want to see the code in your plugin. And, again, I'll repeat that you should be putting the *variable* name into a template. You CANNOT use php in a template, which means you CANNOT do an echo statement. You need to simply put the variable in there - and I would NOT name it php (I don't know that that variable named is reserved, but it sounds like it should be).
|
i dont understand. i dont use any html or php tags in the plugin. $php is taken from the yahoo site that i scrape the financial data.
i thought you were not suppose to use php or html in the plugins?. again, i simply use vb 3.8.1 and set up a plugin called currency using vbulletin and global_start as the hook i guess and inserted this code below only:
PHP Code:
$today = date('Y-m-d');
$con = mysql_connect('localhost', 'username', 'passwd1');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("dbname_currency", $con);
$query = "SELECT cur_rate FROM currency WHERE cur_date = '$today' AND cur_code = 'PHP'";
$result = mysql_query($query)
or die(mysql_error());
$row = mysql_fetch_array($result);
$php = $row['cur_rate'];
then in the header template, i used the variable
HTML Code:
<td align="$stylevar[right]" id="header_right_cell">
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else /> </if>
</td>
<td>
<center>
1 USD = PHP $php
</center>
</tr>
</table>
</fieldset>
to produce the philippine peso rate to show on the page. it worked, but then after you refresh the page, it goes away. i just thought it was because of using global_start as the hook and maybe there is a better hook to use? or what is the problem? is this the info u needed?
--------------- Added [DATE]1242104548[/DATE] at [TIME]1242104548[/TIME] ---------------
its working now. lol. not sure what was wrong before but in the future, is there a better hook to use than global_start or does it matter?
or should you create your own hook? how hard is that?