How to display Random Text/s on each page load [MyBB]

by Sozin - 30-04-2015, 10:03 PM
Nan Ihier Gelair Mordor
Posts:
2,636
Joined:
Jan 2015
Likes:
297
Credits:
8,073
Reputation:
89
2 Years of Service
#1
OP
Posted: 30-04-2015, 10:03 PM
Please register or login in order to unlock hidden content.

Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.
We are!
Posts:
1,044
Joined:
Jan 2015
Likes:
108
Credits:
1,914
Reputation:
25
2 Years of Service
#2
Posted: 30-04-2015, 10:39 PM (This post was last modified: 30-04-2015, 10:42 PM by Akay.)
What exactly is this? If i don't mind asking.

Edit: oh yeah. Don't see why this is needed, but nice share I guess.
Closed Account
Posts:
1,383
Joined:
Jan 2015
Likes:
124
Credits:
1,324
Reputation:
30
2 Years of Service
#3
Posted: 30-04-2015, 11:07 PM
It's rare to see Sozin sharing stuff on this section, so it is something awesome then :hurr:
Closed Account
Posts:
1,383
Joined:
Jan 2015
Likes:
124
Credits:
1,324
Reputation:
30
2 Years of Service
#4
Posted: 01-05-2015, 12:45 AM (This post was last modified: 01-05-2015, 01:07 AM by AndresXZ09.)
I think that you can replace that with

Code:
$random = array(
1=>"Blabla",
2=>"Blablabla",
3=>"jkdsa",
4=>"bkjsda",
);
$random_stuff = rand(1, count($random));
$_text = $random[$random_stuff];
Idk

In fact, if you use 'text here' it gives an error (or atleast I get an error) you have to use "text"
We are!
Posts:
1,044
Joined:
Jan 2015
Likes:
108
Credits:
1,914
Reputation:
25
2 Years of Service
#5
Posted: 01-05-2015, 01:31 AM
Good job on sharing it for leechers. :fp:

@AndresXZ09 @Google
Closed Account
Posts:
1,383
Joined:
Jan 2015
Likes:
124
Credits:
1,324
Reputation:
30
2 Years of Service
#6
Posted: 01-05-2015, 01:34 AM
(01-05-2015, 01:31 AM)Kewl Wrote: Good job on sharing it for leechers. :fp:

@AndresXZ09 @Google

Thanks :yus:

Anyway, that's not going to work if not do the proper modifications.
Same shit, different day.
Staff
Posts:
1,358
Joined:
Jan 2015
Likes:
154
Credits:
1,289
Reputation:
84
2 Years of Service
#7
Posted: 01-05-2015, 11:04 AM
Since when do we post the hidden content?
Next time will result in a warning.
Like some, love some, trust none.

[Image: YuwcFg6.png?2]
Nan Ihier Gelair Mordor
Posts:
2,636
Joined:
Jan 2015
Likes:
297
Credits:
8,073
Reputation:
89
2 Years of Service
#8
OP
Posted: 01-05-2015, 03:27 PM
(01-05-2015, 12:45 AM)AndresXZ09 Wrote: I think that you can replace that with


Code:
$random = array(
1=>"Blabla",
2=>"Blablabla",
3=>"jkdsa",
4=>"bkjsda",
);
$random_stuff = rand(1, count($random));
$_text = $random[$random_stuff];
Idk

In fact, if you use 'text here' it gives an error (or atleast I get an error) you have to use "text"

1. Do not share hidden content.
2. IDK what you actually mean and the count stuff is okay Smile
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.
Closed Account
Posts:
1,383
Joined:
Jan 2015
Likes:
124
Credits:
1,324
Reputation:
30
2 Years of Service
#9
Posted: 01-05-2015, 05:56 PM
(01-05-2015, 03:27 PM)Sozin Wrote:
(01-05-2015, 12:45 AM)AndresXZ09 Wrote: I think that you can replace that with


Code:
$random = array(
1=>"Blabla",
2=>"Blablabla",
3=>"jkdsa",
4=>"bkjsda",
);
$random_stuff = rand(1, count($random));
$_text = $random[$random_stuff];
Idk

In fact, if you use 'text here' it gives an error (or atleast I get an error) you have to use "text"

1. Do not share hidden content.
2. IDK what you actually mean and the count stuff is okay Smile

I just said that's another way to do it Tongue
Nan Ihier Gelair Mordor
Posts:
2,636
Joined:
Jan 2015
Likes:
297
Credits:
8,073
Reputation:
89
2 Years of Service
#10
OP
Posted: 01-05-2015, 06:59 PM
(01-05-2015, 05:56 PM)AndresXZ09 Wrote:
(01-05-2015, 03:27 PM)Sozin Wrote:
(01-05-2015, 12:45 AM)AndresXZ09 Wrote: I think that you can replace that with



Code:
$random = array(
1=>"Blabla",
2=>"Blablabla",
3=>"jkdsa",
4=>"bkjsda",
);
$random_stuff = rand(1, count($random));
$_text = $random[$random_stuff];
Idk

In fact, if you use 'text here' it gives an error (or atleast I get an error) you have to use "text"

1. Do not share hidden content.
2. IDK what you actually mean and the count stuff is okay Smile

I just said that's another way to do it Tongue

Just don't share hidden content. Don't make me say this again. Smile
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)