[Snippet] Random Description v.0.0.1 (en)

Snippet-Area for phpBB 3.0.x

[Snippet] Random Description v.0.0.1 (en)

Postby 4seven » Thu 13. May 2010, 18:51 | Userzeit: +1.00 / Do 13. Mai 2010, 19:51

Random Description

Request by: eoinzy
Request Thread: http://www.phpbb.com/community/viewtopi ... 25&start=0

Demo: http://4seven.bplaced.net/forum/phpbb/index.php (f5-action or forum-move req.)

With tis Snippet u can show a random forum-descriptions on each site load

U can edit forum-descriptions simply in a utf8 (without BOM) saved txt-file




Instruction

download package
Random_Description_v_0_0_1.zip
(1.1 KiB) Downloaded 153 times

edit

root/includes/rand_desc/rand_desc.txt

edit notes for rand_desc.txt:

- each description have one line
- don't make empty lines (line-breaks) on begin or end
- html is possible (see pre-edits in rand_desc.txt)
- always save rand_desc.txt after edit with utf8 (without BOM)
- take always notepad++ or a similar editor, who have the utf8 (without BOM) feature

copy

root/includes/rand_desc/*.* > includes/rand_desc/*.*

open

includes/functions.php

find

Code: Select all
    // The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array( 


before add

Code: Select all
    include($phpbb_root_path . 'includes/rand_desc/rand_desc.'.$phpEx); 


find again

Code: Select all
    // The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array( 


after add

Code: Select all
        'SITE_RANDOM_DESCRIPTION'        => utf8_normalize_nfc($items[$item]), 


open

styles/xxxxxx/template/overall_header.html

find

Code: Select all
{SITE_DESCRIPTION} 


replace with

Code: Select all
<!-- {SITE_DESCRIPTION} -->{SITE_RANDOM_DESCRIPTION} 


clear all board- and browser-caches
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Thu 13. May 2010, 18:51 +1.00
Userzeit: Do 13. Mai 2010, 19:51

Return to [Snippet] for 3.0.x



Who is online

Users browsing this forum: No registered users and 0 guests

cron