News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Poll Mod

Started by clemenzo, June 09, 2007, 11:09:33 AM

Previous topic - Next topic

dimdom

Hi clemenzo,

I use two themes. Same problem. But the same happens with the core (default) theme.

I visited your site. And you are right, the problem doesnt show there.

Maybe i must add something to the php code of the TP block...

If you visit my site (picture in my signature) you will see that the I have another TP block on the right (called Media Center) that shows the same odd behaviour in IE7...

clemenzo

This is strange. I do not encounter alignment issue when using IE7 on your site.

clemenzo

Quote from: wilsy on June 10, 2007, 12:19:27 PM
Hi Clemenzo,

Yes, as below: -

Database Error: No database selected
File: /home/rewindla/public_html/forum/Sources/Subs.php
Line: 3364

I have attached the subs.php file.

Regards,

Wilsy.

I think I fixed it! The problem lies in subs.php. Somehow, the query is not getting a connection and hence the error. Note that this fix would cause the mod uninstall to fail. I would probably inform the mod owner about this so that a fixed mod can be released. To fix this temporarily (keep a backup of your original subs.php):

Search:

// --- Begin FlashChat Integration ---
// Only bother grabbing the data if we need it (ie. we're on the board
// index, or the information will be shown at the top of the forum).
// !!! $modSettings['fc_showUserCount'] just needs the count, not the whole query!
if (!empty($modSettings['fc_showUsers']) || !empty($modSettings['fc_showUserCount']) || (empty($context['current_action']) || $context['current_action'] == 'boardindex' || $context['current_action'] == 'forum'))
{
global $boarddir, $db_prefix;
// Get the FlashChat database config (for the prefix)
include($boarddir . '/chat/inc/config.srv.php');
// Load all the users currently in the chat
$result = db_query("
SELECT
fc.userid, fc.state, fc.color, fc.lang, fc.roomid,
fr.name AS roomName, fr.ispublic,
mem.realName, mem.memberName, mem.showOnline, mg.onlineColor,
mg.ID_GROUP, mg.groupName
FROM {$GLOBALS['fc_config']['db']['pref']}connections AS fc
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = fc.userid)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
LEFT JOIN {$GLOBALS['fc_config']['db']['pref']}rooms AS fr ON (fc.roomid = fr.id)
WHERE fc.userid IS NOT NULL
AND mem.ID_MEMBER != 0
ORDER BY mem.realName ASC", __FILE__, __LINE__);


Replace:

// --- Begin FlashChat Integration ---
// Only bother grabbing the data if we need it (ie. we're on the board
// index, or the information will be shown at the top of the forum).
// !!! $modSettings['fc_showUserCount'] just needs the count, not the whole query!
if (!empty($modSettings['fc_showUsers']) || !empty($modSettings['fc_showUserCount']) || (empty($context['current_action']) || $context['current_action'] == 'boardindex' || $context['current_action'] == 'forum'))
{
global $boarddir, $db_prefix, $db_name;
// Get the FlashChat database config (for the prefix)
include($boarddir . '/chat/inc/config.srv.php');
// Get the proper database prefix (including database name)
$fc_prefix = is_numeric(substr($GLOBALS['fc_config']['db']['pref'], 0, 1)) ? $db_name . '.' . $GLOBALS['fc_config']['db']['pref'] : '`' . $db_name . '`.' . $GLOBALS['fc_config']['db']['pref'];
// Load all the users currently in the chat
$result = db_query("
SELECT
fc.userid, fc.state, fc.color, fc.lang, fc.roomid,
fr.name AS roomName, fr.ispublic,
mem.realName, mem.memberName, mem.showOnline, mg.onlineColor,
mg.ID_GROUP, mg.groupName
FROM {$fc_prefix}connections AS fc
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = fc.userid)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
LEFT JOIN {$fc_prefix}rooms AS fr ON (fc.roomid = fr.id)
WHERE fc.userid IS NOT NULL
AND mem.ID_MEMBER != 0
ORDER BY mem.realName ASC", __FILE__, __LINE__);


Hope this helps.. Apologies for the delay!

dimdom

Quote from: clemenzo on June 19, 2007, 07:49:27 AM
This is strange. I do not encounter alignment issue when using IE7 on your site.

OK, here is what I found out...
When the php block lies in the left side, it displays correctly. When i move it to the right side, the text becomes centered...

Strange but true.

clemenzo

What is the url to your default theme? Can you show me a poll block on the right?

dimdom

Hi once again.

I set up a test SMF so I could test your and some others useful mods.

Your mod works without problems there both in IE7 and Firefox.

That leads me to the conclusion that some other block in my main forum's right panel may cause the strange behaviour.

It has nothing to do with your excellent mod.


clemenzo

Quote from: dimdom on June 20, 2007, 04:21:20 AM
Hi once again.

I set up a test SMF so I could test your and some others useful mods.

Your mod works without problems there both in IE7 and Firefox.

That leads me to the conclusion that some other block in my main forum's right panel may cause the strange behaviour.

It has nothing to do with your excellent mod.



Cool! Your issue would take some time, adding a mod at a time and refreshing your main screen till you found the cause.

Glad you find my mod useful!

Col

Quote from: clemenzo on June 19, 2007, 09:05:53 AM
I think I fixed it! The problem lies in subs.php. Somehow, the query is not getting a connection and hence the error. Note that this fix would cause the mod uninstall to fail. I would probably inform the mod owner about this so that a fixed mod can be released. To fix this temporarily (keep a backup of your original subs.php):

Hi Clemenzo,

I think your code is the answer to my problems too: http://www.simplemachines.org/community/index.php?topic=139769.msg1127402#msg1127402 I reported pretty much the same problem and possible cause, but I'm no coder. I'll give your solution ago! :)

Col

Your code has indeed resolved the problem for me.

Thanks for posting the solution.

clemenzo


clemenzo

Version 1.01 supports SMF 1.1.3 now..

fangweile

thanks I am coming here to check if it is update to support SMF 1.1.3, thanks clemenzo

wilsy

...for those with the RSS Feed Poster and YouTube mods - Clemenzo's code fixed the compatibility issues (re Flashchat) with those as well :)

Regards,

Wilsy.



Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

Mannie_Fine

#53
Hello,
It seems to work for me, only in the tp block i don't see the colors, just the same color bars. In the forum it shows the color.
see it at my site
http://art.spliffcanvas.net [nofollow]
as a matter of fact when i compare it to wilsey's site mine looks alot off  :-\

clemenzo

I assume you got it fixed? I see it running fine at your site now.. :)

Mannie_Fine

Yes it's fixed now ;). It didn't updated the SSI.php , works like a charm now

srm

Hey guys,

I had this mod installed earlier and it worked fine. Then the admin went in and did nothing but change the number between the () to update the block to a different poll then it started giving an error after that.

then i uninstalled it and re-installed it "succesfully" and tried over again and still getting the same error appearing in the block

here is ther error:

QuoteParse error: parse error, unexpected $ in /home/httpd/vhosts/jaggermafia.com/httpdocs/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 1

Does anyone know why this is?

srm


Vinspire

Great mod , good job clemenzo. Your mod definitely make SMF poll system look more attractive :)

srm

Quote from: clemenzo on June 14, 2007, 09:17:06 AM
Quote from: qubbah on June 13, 2007, 11:34:53 AM
Quote from: clemenzo on June 09, 2007, 11:09:33 AM
Link to Mod

This mod will rotate 10 colours to the poll bars and allow voting from SSI block on default theme of SMF.

To show poll in tinyportal block, add a phpbox and type "ssi_showPoll(X);" into block body where X is a topic number.

Demo
======

Default theme:

http://dev.voixbox.com/index.php?theme=1
http://dev.voixbox.com/index.php?theme=1&topic=2


Custom theme:

http://www.voixbox.com
http://www.voixbox.com/index.php?topic=15182.0


when i used this "ssi_showPoll(X);" with php block this msg appeard

Parse error: syntax error, unexpected $end in /home/myforum/public_html/v3/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 1

Did you replace "X" with a topic number where your poll resides? In my examples, I would have used ssi_showPoll(2); or ssi_showPoll(15182.0);.


Hi, Im getting this same error here and I do have the poll number between the paranthasees exactly right.

Hlep

Advertisement: