If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
How to include Advanced Poll in my smarty-powered site  XML
Forum Index » Support Forum
Author Message
adam
Newbie

Joined: 27/05/2006 18:12:14
Messages: 2
Offline

Hi all,

playing with Advance Poll since yesterday I'm really convinced that
this script is really btw the very best poll scripts available on the web.

However I'm trying to add Advanced Poll to my smarty templates powered
website using the following in my template to include the polls:

{php}
include "/home/net/www/poll/poll_cookie.php";
include_once "/home/net/www/poll/booth.php";
echo $php_poll->poll_process("1");
{/php}

For cookie setup is ok but when calling the second script
using mysql database I get directly mysql related error:

[Sat May 27 14:23:48 2006] [error] PHP Warning: mysql_connect(): Access denied for user 'nobody'@'localhost' (using password: NO) in /home/net/www/poll/include/class_mysql.php on line 32

This is strange because the poll script is working standalone without
any problems and using its database without any errors.

booth.php is requiring config.php file containing all access codes
to its database.

class.mysql.php on line 32 is trying to connect with the following line:

$this->conn_id = mysql_connect($this->db['host'].":".$this->port,$this->db['user'],$this->db['pass']);

so I have tried even to fill all variables directly with my real values
and I got no more mysql errors so mysql connection was successful
however in this case I get the following PHP errors:

PHP Fatal error: Call to a member function on a non-object in /home/net/www/poll/include/class_poll.php on line 37

And class_poll.php line 37 is:

$this->pollvars = $this->db->fetch_array($this->db->query("SELECT * FROM ".$this->tbl['poll_config']));

so this is also database connection related ?

Smarty templates engine is widely used on the web
http://smarty.php.net

My problem seems to be identical to the post dated June 23rd, 2005
on this forum and titled "Advanced Polls + smarty templates"
The author of this post has finally decided to use iframes to workaround
the issue, and that's exactly what I did for now but using iframes becomes
really obsolete and not fully flexible; in addition some browsers like
Opera dont accept my temporary solution.

Smarty templates are using ezSQL class (http://php.justinvincent.com)
to connect to Mysql.
So the connection to mysql is done with the following:
$this->dbh = @mysql_connect($dbhost,$dbuser,$dbpassword);
$db->get_var();
$db->get_results();.....

Concerning the last PHP fatal error I have found related web page at:
http://www.jvmultimedia.com/portal/node/33

Could you please give me some clues or advice to achieve this integration
of Advanced Poll with Smarty.

Thanks in advance for your time

Adam
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Have you put the correct settings in config.inc.php?

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
adam
Newbie

Joined: 27/05/2006 18:12:14
Messages: 2
Offline

Auron wrote:Have you put the correct settings in config.inc.php?


Yes, of course
Advance Pool is working perfectly as standalone script called from
blank php page with all mysql settings in config.inc.php.

Thats the reason I'm wondering why I get this message about
nobody (apache) trying to connect to mysql ?

This is something related to smarty templates but I'm looking for
some advice before start to modify all the code ?
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

I say that because...



Wrong username or password?

This "1" should be 1 only use "..." for newest



Smarty templates allow PHP but I'm not sure if there isn't some sort of conflict between the two somewhere.

Auron

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum