TinyPortal

Development => Block Codes => Topic started by: keith021773 on November 23, 2006, 03:34:01 PM

Title: 2 polls side by side?
Post by: keith021773 on November 23, 2006, 03:34:01 PM
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 (http://www.*********.com/forums/index.php?topic=1904.0)';
Title: Re: 2 polls side by side?
Post by: pvcblue on November 23, 2006, 03:57:35 PM
Have you tried putting them in a table in the block?
Title: Re: 2 polls side by side?
Post by: 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
Title: Re: 2 polls side by side?
Post by: pvcblue on November 23, 2006, 04:43:44 PM
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?
Title: Re: 2 polls side by side?
Post by: keith021773 on November 23, 2006, 09:51:12 PM
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..
Title: Re: 2 polls side by side?
Post by: keith021773 on November 27, 2006, 10:54:55 PM
Anyone have any ideas?    I would really like to put 2 polls on my frontpage side by side..
Title: Re: 2 polls side by side?
Post by: Blue Steel on November 27, 2006, 11:57:53 PM
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]
Title: Re: 2 polls side by side?
Post by: Thurnok on November 28, 2006, 12:16:18 AM
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...
Title: Re: 2 polls side by side?
Post by: keith021773 on November 28, 2006, 05:13:37 AM
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.
Title: Re: 2 polls side by side?
Post by: Thurnok on November 28, 2006, 06:26:48 AM
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.
Title: Re: 2 polls side by side?
Post by: Zetan 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:
Title: Re: 2 polls side by side?
Post by: bluedevil on November 23, 2007, 10:53:00 PM
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.
Title: Re: 2 polls side by side?
Post by: Zetan on November 23, 2007, 11:27:19 PM
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
Title: Re: 2 polls side by side?
Post by: Zetan on November 24, 2007, 12:05:44 AM
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?

Title: Re: 2 polls side by side?
Post by: bluedevil on November 24, 2007, 12:44:24 AM
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.
Title: Re: 2 polls side by side?
Post by: Zetan on November 24, 2007, 12:46:50 AM
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.