The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Widget for random display of old posts?

Go down

In progress Widget for random display of old posts?

Post by vpapadolias on October 3rd 2011, 2:54 pm

Hello, i searched the categories for widgets and portal and went through the first 10 pages. Didn't see a similar question; hope didn't miss it.

My questsion is: Is there a widget to display old posts randomly on the first page (portal)? I have a forum with articles, some of them relatively old by now, which don't get visits anymore. And i was wondering if i can somehow get a random display in an widget of some kind of an article; each time a different one, selected randomly.

Is there something for this? Or can it be constructed? With a code maybe, that i can put in the widget?

Thank you in advance...

vpapadolias
Forumember

Posts : 56
Reputation : 0
Language : English, Greek, German

http://newageastrology.forumotion.com

Back to top Go down

In progress Re: Widget for random display of old posts?

Post by ankillien on October 3rd 2011, 4:07 pm

Hi,

You can use javascript for that. Note that it won't pick up old topics itself, you have to add them in the javascript manually and it will display a random topic from it...

http://www.javascriptkit.com/script/script2/motivatequotes.shtml

You should have basic knowledge of HTML.
avatar
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

http://www.webartzforum.com/

Back to top Go down

In progress Re: Widget for random display of old posts?

Post by vpapadolias on October 21st 2011, 12:06 pm

I'm not sure i did this the way you meant, but here is the code i tried to put in a portal widget...

<iframe src="
<script type="text/JavaScript">

var links=new Array()

links[0]='http://newageastrology.forumotion.com/t48-topic'
links[1]='http://newageastrology.forumotion.com/t145-topic'
links[2]='http://newageastrology.forumotion.com/t142-topic'
links[3]='http://newageastrology.forumotion.com/t33-topic'
links[4]='http://newageastrology.forumotion.com/t30-topic'
links[5]='http://newageastrology.forumotion.com/t16-topic'
links[6]='http://newageastrology.forumotion.com/t15-topic'
links[7]='http://newageastrology.forumotion.com/t14-topic'
links[8]='http://newageastrology.forumotion.com/t13-topic'

var whichlink=Math.floor(Math.random()*(links.length))
document.write(links[whichlink])
</script>
" width="99%" height="99%"></iframe>

Now, this does not work as it is... If i remove the iframe, the rest of the code works alright and return a random url out of the ones selected. But with the iframe i get a meesage you can return to the index and after a 2-3 seconds' delay i get the index page inside the widget window. Here is the snapshot...

http://i44.servimg.com/u/f44/14/44/49/54/index10.jpg

Any ideas?

vpapadolias
Forumember

Posts : 56
Reputation : 0
Language : English, Greek, German

http://newageastrology.forumotion.com

Back to top Go down

In progress Re: Widget for random display of old posts?

Post by vpapadolias on October 25th 2011, 3:49 pm

Any luck with that?

vpapadolias
Forumember

Posts : 56
Reputation : 0
Language : English, Greek, German

http://newageastrology.forumotion.com

Back to top Go down

In progress Re: Widget for random display of old posts?

Post by vpapadolias on November 3rd 2011, 1:22 pm

Hello... Did anyone by any chance look into that? Anyone tried it?

vpapadolias
Forumember

Posts : 56
Reputation : 0
Language : English, Greek, German

http://newageastrology.forumotion.com

Back to top Go down

In progress Re: Widget for random display of old posts?

Post by vpapadolias on November 19th 2011, 2:07 pm

I tried getting texts out of the domain to another server i have and get them from there with iframe, but this still doesn't work... It still shows "You can retutn to the index" and after 3-4 seconds displays the main forum page. Why is that? Am i doing something wrong with the code? Here is what i write...

<iframe src="
<script type="text/JavaScript">

var links=new Array()

links[0]='http://www.newagehoroscopes.com/astrology_scripts/esoteriki_1.html'

var whichlink=Math.floor(Math.random()*(links.length))
document.write(links[whichlink])
</script>
" width="99%" height="99%"></iframe>


Please not if i try a simple

<iframe src="http://www.newagehoroscopes.com/astrology_scripts/esoteriki_1.html" width="99%" height="99%"></iframe>

it works fine...

vpapadolias
Forumember

Posts : 56
Reputation : 0
Language : English, Greek, German

http://newageastrology.forumotion.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum