Jump to content

Polls . Positioned between topic & 1st reply


gabs007

Recommended Posts

Posted

I've been thinking recently that polls should go between the topic 1st post and the 1st reply ?

Why ? Well, because for me it's obvious that you can explain your case in the topic and after that offer poll options to the users and members.
People would read the topic and vote right away instead of having to scroll up. Most never do.
Adding the poll on the top of the topic might be useful, but on the 2nd page of the topic, not in the 1st page of the thread.

I give this idea in case someone is interested in creating something like this.  A wdiget that moves the polls to the a different position.
I would buy it if someone adds it to the marketplace. It shouldn't be difficult.

Posted

not really a plugin change needed, all you need to do is modify the theme you use to re-position the poll to where you want. If you need to know how to do this, let me know and i can explain it to you

Posted

@gabs007 Go to AdminCP->Customization->Themes, then which ever theme you want to modify, click the </> icon to the right of it to modify the html & css.

In the theme customization screen, click forums->front->topics->topic.

Scroll down to where you see the code

{{if $poll = $topic->getPoll()}}
{$poll|raw}
<br>
{{endif}}

if you click the gear icon at the top right of the editor you can enable line numbers and it should be around line number 206 (on default theme. not sure about custom themes).

Delete the code shown above, then scroll down untill you find the code:

{{foreach $comments as $comment}}
	{{if !$topic->isQuestion() and !$lined and $timeLastRead and $timeLastRead->getTimestamp() < $comment->mapped('date')}}
		{{if $lined = TRUE and $postCount}}
			<hr class="ipsCommentUnreadSeperator">
		{{endif}}
	{{endif}}
	{{$postCount++;}}
	{template="postContainer" group="topics" app="forums" params="$topic, $comment, $votes"}
	{{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}}
		{$advertisement|raw}
	{{endif}}
{{endforeach}}

and replace with:

{{foreach $comments as $comment}}
  {{if !$topic->isQuestion() and !$lined and $timeLastRead and $timeLastRead->getTimestamp() < $comment->mapped('date')}}
    {{if $lined = TRUE and $postCount}}
    	<hr class="ipsCommentUnreadSeperator">
    {{endif}}
  {{endif}}
  {{$postCount++;}}
  {template="postContainer" group="topics" app="forums" params="$topic, $comment, $votes"}
  {{if $poll = $topic->getPoll() AND $postCount == 1 }}
          <br>
		{$poll|raw}
		<br>
	{{endif}}
  {{if $postCount == 1 AND $advertisement = \IPS\core\Advertisement::loadByLocation( 'ad_topic_view' )}}
  	{$advertisement|raw}
  {{endif}}
{{endforeach}}

and voila your polls are now under the first post

 

Untitled.png

  • 3 weeks later...
Posted

Thanks for the help. It's been taking me a while for different reasons to check this.
Unfortunately that modification is not working with the theme I'm using  for that particular website; it works however in my second website ( which I don't need >_< )
Theme creator declines to help with this, so I will give up for now. 

On a side note for reflection, I find fascinating this poll thing. :p it's like if someone in the phpnuke era decided that polls should go on the top of the page and nobody has ever questioned that or thought about that anymore, following by vbulletin and other softwares.  It reminded the me story about the 10 monkeys in the room and the banana hanging from the ceiling. 

Posted

if its working on one but not on the other, it could be a cache issue, theme files by default are cached by IPS itself so you might need to just clear the cache and it might work then

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...