This is an old bug from at least 0.86, but probably older than that (0.75 :o?):
A featured poll that is shown on the frontpage with the ssi_showPoll command on an intermittently basis shows the results rather than vote form for the poll, even though the user hasn't voted yet. But, as soon he/she goes to the forum or to another page, the vote form suddenly pops up :o...
you will need to employ this method
http://www.tinyportal.net/index.php?topic=9623.0;topicseen
Thanks, that might to do the trick :). BUT, I'm more concerned with making the trick included in future TP releases - not to make patches now and then, patches that most likely will disappear next time I upgrade TP :tickedoff: :-\. This disfeature of the showPoll command must be considered a bug, not something we have to live with... Do you agree with that?
This is not a bug in TP. This is a bug in SMF.
The ssi_showPoll() function is an SMF created function. It doesn't matter whether you put the call in a TP block, or a static webpage somewhere, the results will be the same. In otherwords, you only see the results of the poll, unless you use my hack of the SSI.php file.
The Problems:
1) SMF's ssi_showPoll() function does not get the board number of the topic passed to it when making the db call.
2) When checking the "poll_vote" permission, you must pass the board number to base the permission check on, otherwise, the allowedTo() function assumes the "current board". Well, when you are not in any board, there is no "current board".
Since using SSI functions "generally" indicates you are calling from outside the board (i.e. not in any board), the ssi_showPoll() function (an SMF convention) is what is broken. Not TP. The fix is my hack pointed to in Aku's post above.
OK, I see it from your devs' point of view. But I also see it from the user's point of view, and as such I'm not too concerned what makes the bug occur - SMF or TP. Thing is, will your hack work and in that case will it be implemented in anyway into future releases? I hate losing things when upgrading, especiallyt those that should be included into the distributions in the first place...
This site is a support site for TP only, not SMF. That was my point when making the statement that it is not a bug in TP. There is nothing that TP can do to support this, it has to be handled by SMF. TP and SMF are not the same product. TP is simply a mod, like other mods, to enhance your SMF site (albeit absolutely the best mod available for SMF). In that perspective, it is not TP's responsibility, nor can it be, to fix SMF issues. Nor can we absolutely support any non-TP fixes you might find here.
That being said, we here at TP do try to help out with things that are found to be issues, even when they are not a "TP" issue. This is in fact, the reason you found a "fix" here for this SMF issue.
The hack works for SMF 1.1 RCx thru SMF 1.1.1. It may or may not work for future releases of SMF. However, many members of the TP community including myself, actually use this hack. I will certainly update it for future releases of SMF. If I were to ever leave the TP community (extremely unlikely), or leave this earth/life (hopefully not for quite a long time, but who really knows), I have the utmost confidence that someone else here in the TP community would carry it on.
Frankly, the TP community is one of the finest you will ever find.
Quote from: Thurnok on January 30, 2007, 08:29:46 PM
Frankly, the TP community is one of the finest you will ever find.
Couldn't have put it better myself Thurnok, got a tear in my eye :'(
Yes, I also agree with you in many ways Thurnok! After all, I've been hanging around here quite a while now and I know you all do your best to rescue me :o as well as any user out there that may be just as handicapped :laugh:... So I'm not saying this out of lack of gratitude, not for one sec.
Still I get :tickedoff: every time I have to search for all those hacks and fixes again and again after updating TP or SMF. I know you cannot do the SMF support kind of thing, and that is not what I'm asking for. I guess what I'm asking for is to get some creative initiative to solve a practical issue, not just to hack my code. See?
Btw: Howcome it works as it should as I login as admin, but not as an regular user or global moderator? That is, the vote form appears as I'm login as admin but only the vote results appear as I login as user/moderator...
Because Admins never fail the allowedTo('poll_vote') security check.
OK, thanks!