[RC1] Random Quotes 1.7.2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Arglwydd
Registered User
Posts: 133
Joined: Tue Dec 06, 2005 7:58 pm
Location: Wales, UK
Contact:

Re: [RC1] Random Quotes 1.7.2

Post by Arglwydd » Thu Apr 05, 2007 9:00 pm

This MOD is working fine on the two boards I initially installed it on, phpBB2.0.22, but when I downloaded a fresh copy of the MOD and installed it on another site, there were two problems; first of all there's a row within the mods configuration, with a small, empty box like the kind you type into, and nothing written beside it. Second problem is that I've played around with it and I cannot get the quotes to actually display on the header. It's adding them all to the database fine, but they're not displaying.
MythicalRealmRPG.net! A roleplaying site for adult writers!
LCNA - A mafia-themed text-based roleplaying game for all ages!

User avatar
dfritter4
Registered User
Posts: 479
Joined: Wed Jul 20, 2005 6:39 pm
Location: Ohio
Contact:

Re: [RC1] Random Quotes 1.7.2

Post by dfritter4 » Tue Apr 24, 2007 4:41 pm

the little small empty box was an addition that i was planning to add until i stopped messing around with this MOD.

originally it was going to be a box to type in the type of separator you wanted to use. you should be able to just ignore it or take it out in the tpl file (if u dont know how to do this, just dont worry)

also, use the functions_quotes.php that i posted in my previous post: here it is again:

Code: Select all

    <?php
    /***************************************************************************
    *                             functions_quotes.php
    *                            -------------------
    *   begin                : Thursday July 12 2006
    *   copyright            : (C) 2006 dfritter4
    *   email                : dfritter4@yahoo.com
    *   website           : http://www.motrclan.com
    *
    *   $Id: quotes.php,v 0.0.1 2006/07/12 12:32:09 dfritter4 Exp $
    *
    *
    ***************************************************************************/

    /***************************************************************************
    *
    *   This program is free software; you can redistribute it and/or modify
    *   it under the terms of the GNU General Public License as published by
    *   the Free Software Foundation; either version 2 of the License, or
    *   (at your option) any later version.
    *
    ***************************************************************************/

    //just going to define one little function so that we dont have to write all the code out in the page_header.php

    function exec_rndm_quotes() {
       global $rndm_quotes, $quotes_bold, $quotes_italic, $quotes_underline, $rndm_quotes_array, $board_quotes;
       

    //take the long original string and split it into individual quotes in the $rndm_quotes_array    
    $rndm_quotes_array = explode(" | ", $board_quotes['rndm_quotes']);

    //shuffle the values of the rndm_quotes_array to get a randomly generated effect
    shuffle($rndm_quotes_array);

    //pick a random quote with the a default index array search since the indexes
    // of rndm_quote_array will be different every time
    $rndm_quotes = $rndm_quotes_array[0];

    //get the different formatts and tell each one what theyre supposed to do
    // like bold, italic, and underline
    // BTW MOD TEAM THAT WILL BE READING THIS: if there's an easier way, feel free
    // to let me know
       if( $board_quotes['quotes_bold'] == TRUE )
       {
          $quotes_bold = 'b';
       }
       else
       {
          $quotes_bold = 'nothing';
       }
       if( $board_quotes['quotes_italic'] == TRUE)
       {
          $quotes_italic = 'i';
       }
       else
       {
          $quotes_italic = 'nothing';
       }
       if( $board_quotes['quotes_underline'] == TRUE)
       {
          $quotes_underline = 'u';
       }
       else
       {   
          $quotes_underline = 'nothing';
       }
       if( $board_quotes['quotes_onoff'] == FALSE)
       {
          $rndm_quotes = "";
       }
       else
       {
          //do nothing because we want the quotes turned on   
       }
       
    }

    //this is a function for selecting the font. it took me forever to figure out how to do this perfectly btw ;)

    function quotes_font_select($default, $select_name = 'quotes_font')
    {
       global $quotes_font, $lang;

       if ( !isset($default) )
       {
          $default == $font_name;
       }
       $quotes_font = '<select name="' . $select_name . '">';

       while( list($font_name, $font_name_appearance) = @each($lang['quotes_font']) )
       {
          $selected = ( $font_name == $default ) ? ' selected="selected"' : '';
          $quotes_font .= '<option value="' . $font_name . '"' . $selected . '>' . $font_name_appearance . '</option>';
       }
       $quotes_font .= '</select>';

       return $quotes_font;
       
    }

    //this is a function for selecting the font size. same as font style function

    function quotes_font_size_select($default, $select_size = 'quotes_font_size')
    {
       global $quotes_font_size, $lang;
       
       if (!isset($default) )
       {
          $default == $font_size;
       }
       $quotes_font_size = '<select name="' . $select_size . '">';
       
       while( list($font_size, $font_size_appearance) = @each($lang['quotes_font_size']) )
       {
          $selected = ( $font_size == $default ) ? ' selected="selected"' : '';
          $quotes_font_size .= '<option value="' . $font_size . '"' . $selected . '>' . $font_size_appearance . '</option>';
       }
       $quotes_font_size .= '</select>';
       
       return $quotes_font_size;
       
    }
    ?>

User avatar
dfritter4
Registered User
Posts: 479
Joined: Wed Jul 20, 2005 6:39 pm
Location: Ohio
Contact:

Re: [RC1] Random Quotes 1.7.2

Post by dfritter4 » Sat May 05, 2007 7:08 pm

you can put the code that EasyMOD keeps failing pretty much anywhere in the overall_header.tpl

just take the code thats in the install and put it wherever you want the quotes to show up.

User avatar
dfritter4
Registered User
Posts: 479
Joined: Wed Jul 20, 2005 6:39 pm
Location: Ohio
Contact:

Re: [RC1] Random Quotes 1.7.2

Post by dfritter4 » Sun May 06, 2007 10:51 pm

no problem. glad you were able to get it working!

krisbfunk
Registered User
Posts: 150
Joined: Mon Jul 10, 2006 1:47 am

Re: [RC1] Random Quotes 1.7.2

Post by krisbfunk » Fri Oct 12, 2007 3:00 pm

Any way to get this to show a random quote a day, rather than random on reload?

User avatar
dfritter4
Registered User
Posts: 479
Joined: Wed Jul 20, 2005 6:39 pm
Location: Ohio
Contact:

Re: [RC1] Random Quotes 1.7.2

Post by dfritter4 » Sat Oct 13, 2007 2:19 pm

it definitely is possible.

youd just have to add some code in functions_quote.php

unfortunately i just dont have time anymore to be working on my phpBB mods now that im in college.

User avatar
dfritter4
Registered User
Posts: 479
Joined: Wed Jul 20, 2005 6:39 pm
Location: Ohio
Contact:

Re: [RC1] Random Quotes 1.7.2

Post by dfritter4 » Wed Jun 25, 2008 8:00 pm

just curious, has anyone downloaded this and is using it on their board? i never did finish this MOD enough to get it validated, but it still works from what i can remember.

Post Reply

Return to “[2.0.x] MODs in Development”