xoops forums

risto

Not too shy to talk
Posted on: 2004/3/31 7:24
risto
risto (Show more)
Not too shy to talk
Posts: 159
Since: 2003/4/16
#1

poll force view

Hi I would like to force viewing of polls whan a user has voted. IE not the form any more for that poll.

Has anyone seen this done in xoops?

KubaZ

Just popping in
Posted on: 2004/3/31 8:43
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#2

Re: poll force view

Yes, I've hacked polls, but I'm using it in forum.

but I can make this hack for you... please be patient
(hack only polls module)

---------------

Link xoopspoll hacked

Ok I've made it!

here you are :
* hacked block (php + template)
* hacked index.php

I don't know if you want to see results also in poll's block but I've made it...
in block one thing is important, in poll result standard modifier for width of the bar is x2. But it doesn't look well, so I've changed it to x0.6

If you wanna another, please free to change code in file
blocks/xoopspoll.php at line:
59: $width = intval($percent)*0.6;

ps. for developers. maybe we can add this feature in main core of polls module. We can put a option to the admin panel (if we want to show hacked or original version)

Link :xoopspoll hacked

KubaZ

Just popping in
Posted on: 2004/3/31 10:06
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#3

Re: poll force view

enjoy

hmm..when I've edited my post the time hasn't been changed..so I reply ...

kwerle

Just popping in
Posted on: 2004/4/3 0:01
kwerle
kwerle (Show more)
Just popping in
Posts: 7
Since: 2004/3/25
#4

Re: poll force view

I tried installing your hack 'in place', but it didn't work. Instead, the poll listed with textboxes that had number in them corresponding to the poll choice.

I certainly would like to see this functionality rolled into the core. If you can't vote again, why not show the results!?!

zer0fill

Not too shy to talk
Posted on: 2004/6/12 9:43
zer0fill
zer0fill (Show more)
Not too shy to talk
Posts: 137
Since: 2003/12/2
#5

Re: poll force view

Doh! I wish I searched the forums before making my own poll hack (zip|tar). My hack doesn't use PHP in the block since I modified the assignResults() function to return the array than assign if the user is $in_block (viewing block). Like what KubaZ said, i too shrunk the width to fit in the column.

If you're still having trouble, remember to update the module AND make a backup copy of the original before implementing ours.

I would have placed it on the same line but it didn't look right when the numbers went to the next line.
Resized Image

jayjay

Not too shy to talk
Posted on: 2004/7/27 8:27
jayjay
jayjay (Show more)
Not too shy to talk
Posts: 175
Since: 2003/9/10
#6

Xoopspoll hack: view results in block (Was: Re: poll force view)

Hi everybody!

I hacked Kubaz' hack of the xoopspoll module

Now you can show poll results in a block, so you can display them directly on your homepage.

Download the hacked xoopspoll file

An example can be seen here (only this week) or at the bottom of this post:
http://www.sint-niklaas.be

Starting from Kubaz' hack, I changed these files:

xoops_version.php:
- made new entries under "blocks"

blocks/xoopspoll.php:
- made new b_xoopspoll_results() function
- sprintf hack for better display percentages

language/english/modinfo.php:
- new entry for results block name

Resized Image

Basie

Just popping in
Posted on: 2004/7/28 23:40
Basie
Basie (Show more)
Just popping in
Posts: 12
Since: 2004/7/3 2
#7

Odd glitch

I'm the same... with all of these hacks, I see text boxes instead of images.

My process to install:
1. Delete original xoopspoll directory (start fresh).
2. Upload new xoopspoll directory from hack archive.
3. Update the module from the admin interface.
4. Re-generate template (in one case: xoopspoll_block_results.html).
5. Clear templates_c.

Why on earth would text boxes appear? Something I'm missing here?

Resized Image

Edit: it seems to be using xoops_block_poll.html when it should be using xoops_block_results.html?

Edit2: the above shot was taken while the site had jayjay's version installed.

Basie

Just popping in
Posted on: 2004/8/2 10:02
Basie
Basie (Show more)
Just popping in
Posts: 12
Since: 2004/7/3 2
#8

Re: Odd glitch

Bump...

Anybody got any clues on this one?

hmagoo

Just popping in
Posted on: 2004/8/6 10:14
hmagoo
hmagoo (Show more)
Just popping in
Posts: 15
Since: 2004/7/31
#9

Re: Odd glitch

I originally had a problem getting the template for the new block to generate. I must not have done things in the proer order. So I uninstalled the module, deleted the directory, deleted templates_c, then uploaded again and installed, and generated and everything is working well. Thanks for the mod.

jayjay

Not too shy to talk
Posted on: 2004/11/5 7:52
jayjay
jayjay (Show more)
Not too shy to talk
Posts: 175
Since: 2003/9/10
#10

Re: Xoopspoll hack: view results in block (Was: Re: poll force view)

Hi everybody!

Due to an update of my site to XOOPS version 2.0.7, some mod_rewrite tricks don't work anymore :-/ Hope the issue gets fixed soon...

In the meanwhile you can download my xoopspoll hack from this url:
http://www.sint-niklaas.be/modules/wf ... glefile.php?cid=18&lid=22