TinyPortal

Development => Block Codes => Topic started by: HaxXxoR on March 28, 2006, 07:29:39 PM

Title: Polls
Post by: HaxXxoR on March 28, 2006, 07:29:39 PM
Is there a way to add a block to the site that is linked to a certain section in the forums so that when you make a new poll that it shows up in the block. Just thought it would be a cool idea. Let me know. Thanks in advance.
Title: Re: Polls
Post by: insanemustang on March 28, 2006, 08:21:19 PM
I too would be interested in seeing this.  I know you can link to an external poll, but that defeats the purpose of having it on the forums at all.

Hope someone can do it!
Title: Re: Polls
Post by: MentalMuscle on March 28, 2006, 09:05:24 PM
I believe this should do it:

ssi_showPoll($topic);

I got the code from this post:

http://www.tinyportal.net/smf/index.php?topic=1930.0
Title: Re: Polls
Post by: insanemustang on March 28, 2006, 10:52:50 PM
that thread is super confusing to me
Title: Re: Polls
Post by: HaxXxoR on March 28, 2006, 10:55:32 PM
same here..... is there a way to create a new section in the forums for polls only and then just tie it in with that?
Title: Re: Polls
Post by: MentalMuscle on March 29, 2006, 01:31:05 PM
Although I'm not an SMF guru at first glance all you should have to do is replace $topic in the parenthesis with the top # as shown in the URL

ssi_showPoll(topic=3752);
Title: Re: Polls
Post by: MentalMuscle on March 29, 2006, 01:35:33 PM
Quote from: HaxXxoR on March 28, 2006, 10:55:32 PM
same here..... is there a way to create a new section in the forums for polls only and then just tie it in with that?

I'm sure there is, but to have one poll show at a time other variables would need to be specified to determine latest poll created.  The PHP block code would still use $topic to display a single poll.
Title: Re: Polls
Post by: insanemustang on March 29, 2006, 03:35:31 PM
And what kind of block do we put ssi_showPoll(topic=3752); in
Title: Re: Polls
Post by: IchBin on March 29, 2006, 03:37:04 PM
phpbox
Title: Re: Polls
Post by: Xarcell on March 29, 2006, 04:33:58 PM
There is no "polls only" feature within SMF. I been requesting it since last year, and was really hoping it would be in 1.1, but it's not.

If you want to help support adding that feature to SMF, so that in certain boards, user's can only make polls, reply to this thread: http://www.simplemachines.org/community/index.php?topic=65873.0

Title: Re: Polls
Post by: insanemustang on March 29, 2006, 04:43:59 PM
Quote from: IchBinâââ,¬Å¾Ã,¢ on March 29, 2006, 03:37:04 PM
phpbox
ty
Title: Re: Polls
Post by: WeBrain on April 19, 2006, 07:30:42 PM
I get this error written in the block i tried to put poll on :
Parse error: parse error, unexpected '=' in /home/webrain/public_html/skyshark/forum/Sources/Load.php(1607) : eval()'d code(34) : eval()'d code on line 1

Block is a php one and only has :"ssi_showPoll(topic=36);" in it
TP 0.8.6 SMF 1.1RC2
Title: Re: Polls
Post by: HaxXxoR on April 19, 2006, 07:52:37 PM
Try it without no quotes "" in it and it should work
Title: Re: Polls
Post by: WeBrain on April 19, 2006, 07:59:56 PM
lol it has no quotes in it lol  ;)
Title: Re: Polls
Post by: HaxXxoR on April 19, 2006, 08:01:19 PM
oh lol sorry it looked like it.
Title: Re: Polls
Post by: rbh on April 20, 2006, 01:55:48 AM
i got it to work by not using the topic=, just the topic number. instead of ssi_showPoll(topic=36); i use ssi_showPoll(36); of course changing the topic number to match yours. the only thing is, dont use frames from theme, at least the one i tried looked like crap. also, it only pulls the results, you can't actually vote from the box which is what i was hoping for. unless i am not doing something correct anyways.
Title: Re: Polls
Post by: elpvn on April 27, 2006, 05:14:17 PM
Work fine, that's a good solution for now  ;D

Creat a PHP bloc and add this

ssi_showPoll(number_your_poll_topic);


Ex:
topic= 36.0 has been post a poll then u just using this

ssi_showPoll(36);


Thank rbh for code  ;)
Title: Re: Polls
Post by: Larathiel on June 19, 2006, 10:44:13 AM
Quote from: rbh on April 20, 2006, 01:55:48 AM
i got it to work by not using the topic=, just the topic number. instead of ssi_showPoll(topic=36); i use ssi_showPoll(36); of course changing the topic number to match yours. the only thing is, dont use frames from theme, at least the one i tried looked like crap. also, it only pulls the results, you can't actually vote from the box which is what i was hoping for. unless i am not doing something correct anyways.
Adding a quick little link below the poll results fixes that. :)

ssi_showPoll(99);
echo '<small><a href="http://forums.blahblahblah.com/index.php?topic=99">vote here</a>';
Title: Re: Polls
Post by: rjholla2003 on August 17, 2006, 06:31:34 PM
SSI Poll = Very good. :)  The flash poll I was using looked so nice, but it would dump tenths of a percent into the last option, throwing off all of the percentages.
Title: Re: Polls
Post by: RoarinRow on August 17, 2006, 10:10:10 PM
Quote from: Larathiel on June 19, 2006, 10:44:13 AM
Quote from: rbh on April 20, 2006, 01:55:48 AM
i got it to work by not using the topic=, just the topic number. instead of ssi_showPoll(topic=36); i use ssi_showPoll(36); of course changing the topic number to match yours. the only thing is, dont use frames from theme, at least the one i tried looked like crap. also, it only pulls the results, you can't actually vote from the box which is what i was hoping for. unless i am not doing something correct anyways.
Adding a quick little link below the poll results fixes that. :)

ssi_showPoll(99);
echo '<small><a href="http://forums.blahblahblah.com/index.php?topic=99">vote here</a>';


Sweet, thank you.  I've been waiting simple like this that utilized the existing forum s/w.
Title: Re: Polls
Post by: rjholla2003 on August 18, 2006, 06:49:35 AM
Is there a way to modify the way that the polls look in the block?  I just need the percentages and number of votes to display on their own line, and more spaced out.  Right now it's a bit on the squashed side.  Also, the bar for the highest rated option likes to extend beyond the block's boarder.
Title: Re: Polls
Post by: rjholla2003 on August 20, 2006, 05:47:54 PM
Bippity Boppity Bump.
:)
Title: Re: Polls
Post by: Thurnok on August 21, 2006, 07:09:00 PM
In my opinion, TinyPortal should have its own, independent, poll system.  I never really liked putting a poll block based upon a forum posted poll.

The poll system should:
... just to name a few.

It would be best if it were built right into TP and have its own admin configuration area in the SMF CP under the TP Section.  In lieu of that, I wouldn't mind a mod or even block snippet to fill in until Bloc decides it really should be in TP. ;)
Title: Re: Polls
Post by: akulion on September 01, 2006, 05:39:28 AM
For people interested in making SMF polls working with TP --> our top notch crack PHP coder Thurnok (http://www.tinyportal.net/smf/index.php?action=profile;u=7091) has devised a method to make it work...please read instructions here (http://www.tinyportal.net/smf/index.php?topic=5679.msg65481#msg65481)

Title: Re: Polls
Post by: Puchu on October 24, 2006, 03:23:12 AM
The code that was like this one didn't close out the small... making everything below it block wise messed up... (atleast on my site)


ssi_showPoll(99);
echo '<small><a href="http://forums.blahblahblah.com/index.php?topic=99">vote here</a></small>';



For some reason the quote thing went all crazy lol  so yeah...

EDIT:

I tried to use the code on a left/right block, the title runs on if its longer, and the bar will go out as far as the title...
Anyway to make that smaller???
Title: Re: Polls
Post by: Thurnok on October 24, 2006, 09:05:27 PM
Try following this (http://www.tinyportal.net/smf/index.php?topic=9869.0), should work right if you follow the whole thing through...
Title: Re: Polls
Post by: akulion on October 24, 2006, 09:14:22 PM
aahhh there it is!! I was looking for that link lol - totally puzzled as to what happend to the link in my post :2funny:

im gona update the snippets and put only 1 poll link as urs in there :up:
Title: Re: Polls
Post by: Thurnok on October 24, 2006, 09:16:17 PM
Sorry Aku, I messed you up.. hehe.. I posted that one so the info would be in the first post but forgot to tell ya.  hehe.. sorry bro