TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 02:39:52 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 212
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 57
  • Total: 57

2 polls side by side?

Started by keith021773, November 23, 2006, 03:34:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

keith021773

I use this code to pull polls from the forums to the TP frontpage in a center block.   If I add another poll to it, it will put them vertically on each other.   I was hopeing for a way to have them side by side in the same block.   Can this be done?    Here is the code I use.

Quotessi_showPoll(1904);
echo '<large>Vote here';

pvcblue

Have you tried putting them in a table in the block?

keith021773

I put the above code in a PHPblock.   Can you do a table in a phpblock?   I'm sorry, but I really don't know what I'm doing.   LOL

pvcblue

Quote from: keith021773 on November 23, 2006, 04:18:54 PM
I put the above code in a PHPblock.   Can you do a table in a phpblock?   I'm sorry, but I really don't know what I'm doing.   LOL

yes tables can be used in php - I have block on my front page that has tables and it is php - I didnt create it tho, so maybe someone here can fix your block?

keith021773

Anyone have a suggestion?     Somehow I need to take the above code and make it to where I can use it twice in the same phpbox but have the main page display it next to each other instead of displaying it on top of each other..

keith021773

Anyone have any ideas?    I would really like to put 2 polls on my frontpage side by side..

Blue Steel

This should work .. I havn't tried it though

Create a frontpage block .. in it put something like this (remembering to change the pollnumbers and url's of course)


<table><tr><td>
ssi_showPoll(1904) <br />
<a href="http://www.*********.com/forums/index.php?topic=1904.0" target="_blank">Vote here</a>
</td><td>
ssi_showPoll(384) <br />
<a href="http://www.*********.com/forums/index.php?topic=384.0" target="_blank">Vote here</a>
</td></tr></table>
[ /code]

Thurnok

That won't quite work.. but this should:

echo '<table><tr>
<td>
';
ssi_showPoll(1904);
echo '<br />
<a href="http://www.*********.com/forums/index.php?topic=1904.0" target="_blank">Vote here</a>
</td>
<td>';
ssi_showPoll(384);
echo '<br />
<a href="http://www.*********.com/forums/index.php?topic=384.0" target="_blank">Vote here</a>
</td>
</tr></table>
';


Don't forget to put in a php centerblock, php frontpage block, or php article at your pleasure...

keith021773

Used Thurnoks code and it worked!  Thank you.   They are alittle uneven and not lined up good, but they are there and working..   Thank you Thurnok!  And Thank you all that replied.

Thurnok

You might want to check out my Poll Block w/ associated SSI Hack and see if that will work better for you.  It will allow your members to vote right inside the block itself (no need for the extra link to go vote).

Should be able to find it in the Block Code Snippets section.

Zetan

Cheers for this Thurnok.. Wherever you are hiding these days, hope all is well.

Just added 3 polls for Album of the Year:

http://labradio.co.uk/index.php?action=forum


Works a treat  :up:

bluedevil

Quote from: ZTN on November 23, 2007, 10:39:10 PM
Cheers for this Thurnok.. Wherever you are hiding these days, hope all is well.

Just added 3 polls for Album of the Year:

http://labradio.co.uk/index.php?action=forum


Works a treat  :up:

Very cool Z!

Now you need the colored poll mod from smf.

Zetan

#12
Thanks.. Hmm.. I think I'll grab that, cheers for the heads up  :up:

[edit] Error in Display.template  Nows not a good time to suck and see, I just sent out a newsletter.
It wouldn't look good with a broken forum right now  :P

Zetan

Bugger.. It shows the results to guests and maybe other members that haven't voted, regardless of whether you set the poll to display the results after the poll has expired.

Anyone know of a fix for that?


bluedevil

Maybe i misunderstood this code but i tried it and all it shows is 2 links to the polls.

I thought you get 2 actual polls side by side.

Zetan

you do, there are 3 polls side by side from 3 different topics.. I see radio buttons logged in, logged out, I see the results.. which are set to display Only when the poll has expired.
My members see the results too.. I think it's a bug in the SSI Poll function.