Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] dru_random_text
sophia – if you’re on a *nix computer, “tar xzf filename.tgz” at the commandline should work for you. if you’re on an older mac, stuffit can open the file. if you’re on a windows computer, i do believe winRAR or winACE can open it.
Listen to Kenneth
Offline
Re: [plugin] [ORPHAN] dru_random_text
TIME SENSITIVE RANDOM TEXT!
Someone else might find this useful. I dont know PHP but I have cobbled this together with help from friends…
Copy and paste the following in place of the plugin code… ALWAYS BACKUP THE ORIGINAL FIRST!!!
@
function dru_random_text($atts) // by mr drew mclellan // allinthehead.com
{
global $txpcfg;
if (is_array($atts)) extract($atts);
$source = empty($source) ? ‘file’ : $source;
@
Now its possible to serve up random(ish) text appropriate to the time of day!
If anyone could suggest a more elegant way i’d appreciate it.
Can someone tell me how to get code to display properly on this forum :(
Last edited by Martagnan (2004-09-02 15:50:11)
Offline
#15 2004-09-02 13:21:42
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] dru_random_text
I tried this in my form:
<txp:permlink><txp:dru_random_text source="database" table="textpattern" column="Title" /></txp:permlink>
but then nothing is displayed. Without the permlink tags it displays a random title, but I don’t see much use in that without the permlink.
Is it possible to add the permlink, and how?
Martagnan: put the code between -s.
Last edited by doggiez (2004-09-02 13:22:27)
Offline
Re: [plugin] [ORPHAN] dru_random_text
I put the code between @s as you can see… no difference?
Offline
#17 2004-09-02 20:21:40
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] dru_random_text
And this?
< code >your code< /code >
<del>Edit: can’t seem to get this right :-( I’ll just keep trying until it shows what I want. (why doesn’t this thing have a preview button?)</del>
Edit nr. 387: at last! (just leave out the spaces of course)
Last edited by doggiez (2004-09-02 20:38:09)
Offline
#18 2005-11-23 14:09:33
- EddieG5
- Member
- From: Georgia
- Registered: 2004-03-03
- Posts: 96
Re: [plugin] [ORPHAN] dru_random_text
Has anyone tried this plugin with the latest version of Txp? I’ve got it running on a RC2 install that I’m about to upgrade … does anyone know of any issues I should be aware of or if there is an updated version of the plugin?
Offline
#19 2005-11-23 14:38:16
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] dru_random_text
I have been using it without problems in 4.0.1, stopped using it recently because I found that the same can be achieved with articles and sortby=“rand()”.
Offline
Re: [plugin] [ORPHAN] dru_random_text
I’m using it with 4.0.2 with no issues.
TextPattern user since 04/04/04
Offline
#21 2005-11-23 16:25:10
- EddieG5
- Member
- From: Georgia
- Registered: 2004-03-03
- Posts: 96
Re: [plugin] [ORPHAN] dru_random_text
Excellent … thanks!
Offline
#22 2006-04-04 22:14:13
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Offline
Re: [plugin] [ORPHAN] dru_random_text
Yes it does!
Ren
Offline