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

Recent

Welcome to TinyPortal. Please login or sign up.

May 14, 2024, 11:54:25 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,188
  • Total Topics: 21,220
  • Online today: 176
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 109
  • Total: 109

poll display in block on frontpage

Started by den15b, June 04, 2009, 02:15:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

den15b

#10
[REMOVED]


hope this is right

JPDeni

No.

Do you remember what you did when you created the block? Tell us what you did to make the block you have.

den15b

Ok,
I went to the TinyPortal admin
Then I clicked on "Panels and Blocks"
Then I clicked "Add right block"
Then I selected type "Forum/SSI Functions" / Most recent Poll
Status is On
Choose your membergroups that will able to see this block, to "All"
Choose where the block should appear, to "Frontpage"



Did i get it right this time

JPDeni

Yes. :)

You're using the SSI function. (There are other ways to display a poll than using SSI.)

That seems to have a bug in it, as mentioned by IchBin.

den15b

Quote(There are other ways to display a poll than using SSI.)

OK, do you mind telling me the other ways please

Denis

ZarPrime

#15
Hi den15b,

The reason this is not doing what you want it to do is that the php ssi_recentPoll function allows you to vote but it doesn't display the results.

On my test site, which is http://talesofthehavenexpanse.com/smf1test/index.php, I just added this php block to show the most recent polls in boards 1 and 2.  You must be logged in to vote (this is a security feature, in other words Guests can't vote) but since guests can view the polls, you will be able to see both polls in the block in the right panel.

In order to do this, I used the block code snippet shown here ...
http://www.tinyportal.net/index.php/topic,12807.msg106401.html#msg106401

I changed the last 2 lines in the code to this ...


// display most recent poll from board number 1 and 2
tp_showPoll(null,'echo',1);
echo '<br /><hr />';
tp_showPoll(null,'echo',2);


This allows me to show the most recent poll from both boards.  I voted in the poll in board #1 (the string poll), but not in the poll for board #2 (the dog poll).  If you were allowed to be logged in, you would be able to vote in the second poll right from the block as there would be a submit button below that one.  Once you voted, ths view would change to show the results in the bottom poll just like it is shown for the top poll.

Hope this helps,
ZarPrime

EDIT: I just added a 3rd poll in a 3rd board on my test site and added another line to the bottom of the block code to get the poll in that board.  If you are logged in and haven't voted in any of the polls that are up there, the submit button will be shown for those polls until you vote.  See pic below ...

den15b

Thanks for that, I will try it, by the way, I want to let guests vote as well, any chance of that happening

Regards Denis

ZarPrime

Quote from: den15b on June 05, 2009, 04:59:11 PM
I want to let guests vote as well, any chance of that happening

No, no chance, as far as I can tell.  Why in the world would you want to allow non-members to vote?  Isn't it a goal to get people to be a member of your forum.  Voting is and should be a privelage for members, not for guests.

BTW, it appears that this code will not allow you to vote from the block if you have more than 1 poll showing in the block.  Showing the most recent poll period may be a limitation of the code.  I'll have to look at this later and see if anything could be done about that, or perhaps one of our coders can take a look at it and see if anything can be done about that.

ZarPrime

den15b

QuoteBTW, it appears that this code will not allow you to vote from the block if you have more than 1 poll showing in the block.

Thats Ok with me, I only want 1 poll showing at a time

So no chance with the guest being able to vote, I was hoping they could vote, but not to worry, I have tried that code out & it works perfect, thankyou for your time

Denis

ZarPrime

I don't know of any way to allow guests to vote for this reason ...

How would the software know that a guest has already voted and keep them from voting another 50 times if it didn't register their usernames in the database that they already voted?  I suppose it could be done with IP addresses but then a guest who has access to dynamic IP addresses could still vote multiple times.  I don't think this is something I'd want to see.

Marked solved.

ZarPrime