What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Wordpress help

Wordpress help
Author: Message:
Tasha
Senior Member
****

Avatar

Posts: 717
Reputation: 81
32 / Female / Flag
Joined: Jan 2005
O.P. Tongue  Wordpress help
Hum... Anyone who's familiar with wordpress will know that it has a description for your blog, which you enter in the options panel. What I want to do is have that random, so it comes up with random quotes everytime my site is loaded. (Am I making sense here? =P) So like, in the description bit on www.tashaj.info, where it currently says "test", say, person a loads the page, it'll say "hi!" and person b loads it and it says "lol", how can I make something that randomises it? So basically like a random word thing... But actually in wordpress.

I know I make zero sense. =P
www.mycutelobster.co.uk
"Of course it is happening inside your head, Harry,
but why on earth should that mean that it is not real?"
07-07-2006 09:14 PM
Profile PM Web Find Quote Report
Thor
Veteran Member
*****

Avatar
Awwwwwwww.

Posts: 1118
Reputation: 42
32 / – / Flag
Joined: May 2006
RE: Wordpress help
If u can add PhP code into that window, then here's some code:
code:
<?php

$textArray[0] = "The first line of text!";

$textArray[1] = "Much text!";

$textArray[2] = "Some text...";



$count = count($textArray);
$count = $count - 1;
$random = rand(0, $count);
echo("<p>" . $textArray[$random] . "</p>");

?>


EDIT: Had done something wrong, fixed now...
I haven't tested it, but it should do the trick. :)

This post was edited on 07-08-2006 at 01:03 PM by Thor.
:plus4: Translation guidelines for Messenger Plus! Live
I'm no longer around this town, but I miss the community dearly. You can always find me lurking in #banana, or at
nitrolinken.net.
07-07-2006 09:31 PM
Profile PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Wordpress help
That wouldn't work. I tested it and no it doesnt.
I will make one later :P i am still getting my head round php
Touch Innovation - touch friendly programs/applications for the windows mobile!


07-07-2006 09:58 PM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Wordpress help
code:
<?
$random_text = array
(
"Random Text 1",
"Random Text 2",
"Random Text 3",
"Random Text 4",
"Random Text 5"
);
$count = count($random_text);
$randomize = (rand()%$count);
echo ("$random_text[$randomize]");
?>

Sorry about the DP. This works and is much better ;)
Touch Innovation - touch friendly programs/applications for the windows mobile!


07-07-2006 10:26 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Wordpress help
Is your blog hosted n a Unix server? If so, there's a program called 'fortune': invoke it, and use the output from it as your quote.

This of course requires you have a Unix server with 'fortune' on the PATH, that PHP has read/execute access to it, and that a PHP module is installed to run server-side programs.
[Image: spartaafk.png]
07-07-2006 10:34 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On