Random Quotes in Signature -- Changing text

Need some coding help with a MOD or tweak you are working on? - Ask here.
Forum rules
Ask for support specifically regarding coding help with phpBB3.
Not for generic usability questions or support.

Re: Random Quotes in Signature -- Changing text

Postby Ika » 07 Mar 2008, 21:51

ameisez wrote:
Ika wrote:It is live on my development site now on Glacier style. Click the link in my signature.


Hi, Ika,

i saw your random text on your dev site. how can i apply it on my siteusing glacier style?

thanks


I will see if I can get together a good set of instructions to help you with that. A day or two please.
Image
05.08.09 The Black Ice Project
Please use the forums for support requests. Review the Board Rules here.
Ika    
STG Styles Team
STG Styles Team
 
Posts: 1618
Joined: 08 Jul 2007, 09:57
Location: Charlotte, NC USA
Favorite Team: Pittsburgh Steelers
Gender: Male
phpBB Knowledge: 8




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Random Quotes in Signature -- Changing text

Postby ameisez » 08 Mar 2008, 19:07

Ika wrote:I will see if I can get together a good set of instructions to help you with that. A day or two please.

I will wait :thumbsup:
ameisez    
Lieutenant
Lieutenant
 
Posts: 241
Joined: 23 Jan 2008, 01:15
Gender: Male
phpBB Knowledge: 2

Re: Random Quotes in Signature -- Changing text

Postby Ika » 08 Mar 2008, 23:49

ameisez wrote:
Ika wrote:I will see if I can get together a good set of instructions to help you with that. A day or two please.

I will wait :thumbsup:


viewtopic.php?f=50&t=5481

That is for Glacier but shouldn't be hard to adapt to about anything.
Image
05.08.09 The Black Ice Project
Please use the forums for support requests. Review the Board Rules here.
Ika    
STG Styles Team
STG Styles Team
 
Posts: 1618
Joined: 08 Jul 2007, 09:57
Location: Charlotte, NC USA
Favorite Team: Pittsburgh Steelers
Gender: Male
phpBB Knowledge: 8

Re: Random Quotes in Signature -- Changing text

Postby ameisez » 10 Mar 2008, 18:52

HURAA!! :yahoo:

Installed and works perfectly!!! :thumbsup: :clapping:

THANKS A LOT!!!
ameisez    
Lieutenant
Lieutenant
 
Posts: 241
Joined: 23 Jan 2008, 01:15
Gender: Male
phpBB Knowledge: 2

Re: Random Quotes in Signature -- Changing text

Postby terryzx » 08 Feb 2009, 10:04

I had a big problem getting this to wok until I got the correct code for the sig file:

Code: Select all
<?php

$quotes = 'Random Text 01
Random Text 02
Random Text 03
Random Text 04
Random Text 05
Random Text 06';
$split_array = explode("\n", $quotes);
$rand_keys = array_rand($split_array, 1);

header("content-type: application/x-javascript");
echo "<!--\n
document.write('{$split_array[$rand_keys]}');\n
//-->";

?>
terryzx    
Supporter
Supporter
 
Posts: 164
Joined: 09 Aug 2008, 21:26
Gender: Male
phpBB Knowledge: 4

Re: Random Quotes in Signature -- Changing text

Postby 3Di » 08 Feb 2009, 10:13

there is not a Line Break after Random Text 06 ?
Give Peace A Chance.. Pass ON It!
Image
The door that leads to the Glory is very narrow but it is mandatory to be Great to be able to cross it.
------------------------- phpBB wiki in Italiano - partecipa con il tuo contributo -----------------------
User avatar
3Di    
MOD Author
MOD Author
 
Posts: 249
Joined: 22 Apr 2008, 14:09
Location: Italy
Favorite Team: Milan
Gender: Male
phpBB Knowledge: 8

Re: Random Quotes in Signature -- Changing text

Postby terryzx » 08 Feb 2009, 10:19

I used it as is and now am adding my own lines

But I still can?t get smiles to show unless I add them outside the BBcode
terryzx    
Supporter
Supporter
 
Posts: 164
Joined: 09 Aug 2008, 21:26
Gender: Male
phpBB Knowledge: 4

Re: Random Quotes in Signature -- Changing text

Postby Highway of Life » 08 Feb 2009, 17:26

terryzx wrote:I used it as is and now am adding my own lines

But I still can?t get smiles to show unless I add them outside the BBcode
This is because the Javascript does not go through the parse_bbcode or parse_smilies functions. So they will just appear as plain text. Instead, you can use HTML within your javascript.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: Random Quotes in Signature -- Changing text

Postby Finsta » 13 Feb 2009, 19:27

Spoiler:
NOOB Question:

When I create a dreamweaver php file it adds this.

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
    <?php

    $quotes 
= 'Random Text 01
    Random Text 02
    Random Text 03
    Random Text 04
    Random Text 05
    Random Text 06'
;
    $split_array = explode("\n", $quotes);
    $rand_keys = array_rand($split_array, 1);

    header("content-type: application/x-javascript");
    echo "<!--\n
    document.write('{$split_array[$rand_keys]}');\n
    //-->"
;

    ?>
</body>
</html>


Is that right, also upload to root
.

Edit:
I created a file called 1.php with this code

Code: Select all
    <?php

    $quotes 
'Random Text 01
    Random Text 02
    Random Text 03
    Random Text 04
    Random Text 05
    Random Text 06'
;
    
$split_array explode("\n"$quotes);
    
$rand_keys array_rand($split_array1);

    
header("content-type: application/x-javascript");
    echo 
"<!--\n
    document.write('{$split_array[$rand_keys]}');\n
    //-->"
;

    
?>


Nothing appeared but in firebug I get this:
Code: Select all
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/content/f/i/n/finsta2/html/1.php:1) in <b>/home/content/f/i/n/finsta2/html/1.php</b> on line <b>12</b><br />
<!--

document.write(' Random Text 05');

//-->
"You've changed things... forever. There's no going back. See, to them, you're just a freak... like me!"

--The Joker

Learn more about me @ FreddyGonzalez.me
User avatar
Finsta    
Supporter
Supporter
 
Posts: 148
Joined: 14 Dec 2008, 23:46
Location: Arizona
Gender: Male
phpBB Knowledge: 6

Re: Random Quotes in Signature -- Changing text

Postby Tikva » 17 Feb 2009, 18:12

Hi There,

I would really love to be able to have the Changing Text Signature that you use, Highway of Life, but even though I have tried everything listed in this thread, I have been unable to get it to work. Just in case it helps, I am running Phpbb 3.04. Your help with this would be most appreciated!!
Tikva    
Cadet I
Cadet I
 
Posts: 15
Joined: 19 Dec 2008, 23:58
Location: Dunedin, New Zealand
Gender: Female
phpBB Knowledge: 3

PreviousNext

Return to phpBB3 Coding Assistance

Who is online

Users browsing this forum: No registered users and 9 guests