collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 383
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Quotes block  (Read 14873 times)

0 Members and 1 Guest are viewing this topic.

Offline gibby

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • Tryin' hard...
Quotes block
« on: March 25, 2009, 12:04:18 AM »
Hi

I looked and could not find, is there a block for adding and displaying quotes?

Thanks

Gibby
« Last Edit: March 25, 2009, 12:06:35 AM by gibby »
Love it...

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Quotes block
« Reply #1 on: March 25, 2009, 12:11:02 AM »
What exactly do you mean by 'quotes'?

Do you mean quotes from a posts/topics on your forum? From certain boards?

SimplePortal does have the 'Board News Block' which will display the first x characters from the most recent posts on a certain board.

There are also SimplePortal articles, like on the portal of this website. Which can be enabled using the 'Enable articles' setting. You can then add a category for your articles in the 'Categories' section. Topics can then be made into articles by clikcing the 'Add as Article' link when viewing the topic, or by using the Add Article area in the admin panel.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Immortal

  • Jr. Member
  • **
  • Posts: 62
  • Gender: Male
  • Matrix is my home
Re: Quotes block
« Reply #2 on: March 25, 2009, 12:17:26 AM »
I suppose he mean displaying in block random quotes from file maybe? 

If that's the case, then the easiest way would be add via php block.

Offline gibby

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • Tryin' hard...
Re: Quotes block
« Reply #3 on: March 25, 2009, 12:18:55 AM »
Thanks for the reply

I now know how to configure those items - thanks  :D

I would like a block that I add personal quotes and they are then displayed in the block.

Quotes

Never eat yellow snow

Click for another / if can't do this just refresh to see a new one

I hope you understand

Thanks

Gibby
Love it...

Offline gibby

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • Tryin' hard...
Re: Quotes block
« Reply #4 on: March 25, 2009, 12:19:59 AM »
Thanks

So I just need a php script then add to the php block?

Do you have one  :nervous-happy:

Thanks

Gibby
Love it...

Offline gibby

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • Tryin' hard...
Re: Quotes block
« Reply #5 on: March 25, 2009, 12:22:42 AM »
Currently the news block that is a SMF feature kind of does the job - if I could change News to Quote then that would do, but then I would lose the ability to post some news to the members

A block would be better

Thanks

Gibby
Love it...

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Quotes block
« Reply #6 on: March 25, 2009, 12:33:39 AM »
You should be able to do it with a Simple PHP block. Here is some very basic code that will do what you want if you put it in a PHP block.

Code: [Select]
global $scripturl;

$quotes = array(
'I am me!',
'I think therefore I am!',
'Howzat!',
'Lolz'
);

echo $quotes[rand(0, count($quotes)-1)], '<br /><br />
<a href="', $scripturl, '">Click Here for another Quote.</a>';

You can change the values in the $quotes array to add/change quotes.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline gibby

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • Tryin' hard...
Re: Quotes block
« Reply #7 on: March 25, 2009, 12:45:42 AM »
Where you born GOOD or did you learn it...

wooow - it seems to work

Thanks

I will play and test today

Thanks

Gibby
Love it...

Offline gibby

  • Jr. Member
  • **
  • Posts: 54
  • Gender: Male
  • Tryin' hard...
Re: Quotes block
« Reply #8 on: March 25, 2009, 12:51:34 AM »
Just remember to \ when you have a '

Everything looks good  ;D
Love it...

Offline geekfairy

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Quotes block
« Reply #9 on: August 09, 2009, 09:08:56 PM »
That's excellent, how would I go about centering the text?

Thanks.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Quotes block
« Reply #10 on: August 10, 2009, 02:01:29 AM »
@geekfairy,
The easiest way would be to add "text-align: center;" to the 'Custom Body Style' option for the block.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline geekfairy

  • Semi Newbie
  • *
  • Posts: 19
  • SMF Version: 1.1.10
  • SP Version: 2.3.1
Re: Quotes block
« Reply #11 on: August 10, 2009, 02:24:19 AM »
Thankyou! :) That was embarrassingly easy, I thought I'd have to add something to the code itself.

Thanks again :)

Offline GrannyT

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Quotes block
« Reply #12 on: November 26, 2009, 10:20:40 AM »
Please can someone tell me what I'm doing wrong here - the block is showing but says:
Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/xxxxxxxx/public_html/forum/Sources/PortalBlocks.php(3272) : eval()'d code on line 3

(I know they're corny quotes but they're for our kids site.)
Code: [Select]
global $scripturl;
$quotes = array(
'A dog is a person's best friend',
'I think therefore I am',
'Troubles never seem so bad the next morning',
'Adults are obsolete children.',
'Be Yourself. Who else is better qualified?',
'Children are apt to live up to what you believe of them',
'Imagination is the one weapon in the war against reality',
'Any sufficiently advanced technology is indistinguishable from magic',
'Always do right - this will gratify some and astonish the rest',
'Whatever you can do or dream you can do, begin it',
'Never go to a doctor whose office plants have died',
'Expressing anger is a form of public littering',
'A child needs your love most when he deserves it least',
'Children are like wet cement. Whatever falls on them makes an impression',
'There's no half-singing in the shower, you're either a rock star or an opera diva',
'Dogs have Owners, Cats have Staff',
'Parents are not interested in justice, they're interested in peace and quiet',
'To err is human--and to blame it on a computer is even more so'
);
echo $quotes[rand(0, count($quotes)-1)], '<br /><br />
<a href="', $scripturl, '">Click Here for another Quote.</a>';

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Quotes block
« Reply #13 on: November 26, 2009, 10:46:23 AM »
Escape your single quotes.

Example: 'A dog is a person\'s best friend';

Offline GrannyT

  • Semi Newbie
  • *
  • Posts: 31
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Quotes block
« Reply #14 on: November 26, 2009, 02:02:58 PM »
Thank you ccbtimewiz - now I understand what Gibby meant earlier. :-[ Works fine now. ;D

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Quotes block
« Reply #15 on: April 29, 2010, 09:33:25 AM »
Sorry to wake this topic up but is there a way this can be updated?

Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Quotes block
« Reply #16 on: April 29, 2010, 10:42:28 AM »
There is nothing to update.

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Quotes block
« Reply #17 on: April 29, 2010, 11:17:07 AM »
There is nothing to update.

I tried to add this to a block but had an error.

Also in regards to the link at the bottom where is it supposed to lead to?
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Quotes block
« Reply #18 on: April 29, 2010, 12:11:31 PM »
Did you try a direct select/copy/paste from Nathaniel's quote block?
If you changed any of the quotations, did you remember to put a "\" before any ' in the quotation?
What error did you get?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Quotes block
« Reply #19 on: April 29, 2010, 12:18:10 PM »
Er

Can ya see me  :-[

If I use Nathaniels code it is working.

If I use GrannyTs it doesn't.

All I gotta do now is centre the text and work out where the link should point to.

Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast