#1 Imlianot Giovedì, 28 Giugno 2007, 17:50
non so se a qualcuno è utile ma visto che me lo sto facendo per lo staff di un forum credo che possa tornare utile a molti.
NON LEVATE LE PARTI ESISTENTI
(non credo di violare la licenza di ICY o di PHPBB)
Cominciamo :
dove leggete {vostrocodice} e {vostrocodicestatic} sostiutielo con il "comando" bbcode che volete usare
esempio:
se scrivete tlstaff e tlstaffstatic i bbcode da usare saranno [tlstaff] e [tlstaffstatic] aspetto smentita da un admin
Trovate il file chiamato bbcode.php nella cartella includes
find:
- 'ipstaff' => array(
- 'nested' => true,
- 'inurl' => true,
- 'allow_empty' => true,
- ),
- 'ipstaffstatic' => array(
- 'nested' => true,
- 'inurl' => true,
- 'allow_empty' => true,
- ),
-
aggingete dopo o prima cambia poco
- '{vostrocodice}' => array(
- 'nested' => true,
- 'inurl' => true,
- 'allow_empty' => true,
- ),
- '{vostrocodicestatic}' => array(
- 'nested' => true,
- 'inurl' => true,
- 'allow_empty' => true,
- ),
-
trovate
- // Single tags: ipoverview
-
prima aggiungete
- // Single tags: {vostrocodice}
- if( ($tag === '{vostrocodice}') )
- {
- $html = $lang['{BBC_VOSTRASIGLA_CREDITS'];
- return array(
- 'valid' => true,
- 'html' => $html
- );
- }
-
- // Single tags: {vostrocodicestatic}
- if($tag === '{vostrocodicestatic}')
- {
- $html = $lang['BBC_VOSTRASIGLA_Credits_Static'];
- return array(
- 'valid' => true,
- 'html' => $html
- );
- }
-
-
-
-
fatto questo andate a cercarvi il file di lingua (suggerisco di alterarli tutti)
languagelang_englang_bbc_tags.php
stessa cosa per le altre lingue (sempre che non sia impazzito)
editate il file
trovate la parte chiamata
$lang['BBC_IP_Credits_Static'] = '
praticamente quasi all'inizio
la parte finisce con
- Location: <a href="http://www.icyphoenix.com/">http://www.icyphoenix.com</a>
- ';
-
dopo aggiungete
(attenzione dopo = ' ci vanno parti in linguaggio html basta vi riferiate a quello che già esiste per fare qualsiasi cosa)
- $lang['BBC_VOSTRASIGLA_Credits_Static'] = '
-
-
- qui ci va tutto quello che vi pare basta che finisca con
- ';
-
trovate
- $lang['BBC_IP_Credits'] = '<div class="center-block"><marquee behavior="scroll" direction="up" scrolldelay="120">' . $lang['BBC_IP_Credits_Static'] . '</marquee></div>';
-
dopo aggiungete (su un unica riga)
- $lang['BBC_VOSTRASIGLA_Credits'] = '<div class="center-block"><marquee behavior="scroll" direction="up" scrolldelay="120">' . $lang['BBC_VOSTRASIGLA_Credits_Static'] . '</marquee></div>';
-
e il gioco dovrebbe essere fatto
ora avrete la possibilità di inserire [tlstaff] o [tlstaffstatic] e farlo visualizzare
lo stesso principio vale per qualsiasi cosa vogliate far vedere statica o con marque o con quel che vi pare
tenete conto che dovete scrivere codice HTML e non a caso
Ultimo avvertimento:
se dovete inserire un ' (apice) visto che viene usato dal php per delimitare dei campi dovete usare la sintassi ' mentre per le lettere accentate fate riferimento alla sintassi php per evitare errori di visualizzazione (al limite vi appare uno strano ?)
non me li ricordo a mente ma mi sembra che sia tipo è = e&grave
Versione di IP: 1.3.0.53
Server: Linux
-

Imlianot
-
-
- Età: 37
- Registrato: Giugno 2007
- Messaggi: 267
-
#2 z3d0 Giovedì, 28 Giugno 2007, 18:01
à > à
è > è
ì > ì
ò > ò
ù > ù
-

z3d0
-
VIP

-
- Età: 22
- Registrato: Giugno 2007
- Residenza: TOPICS_TABLE
- Messaggi: 326
-
#3 Imlianot Giovedì, 28 Giugno 2007, 18:33
a ecco lo dicevo che non me li ricordavo a memoria
grazie per l'implementazione
Versione di IP: 1.3.0.53
Server: Linux
-

Imlianot
-
-
- Età: 37
- Registrato: Giugno 2007
- Messaggi: 267
-
#4 Mighty Gorgon Giovedì, 28 Giugno 2007, 18:46
Manca la e con l'accento acuto che, anche se molti non lo sanno, serve a distinguere è da perché...
Ad ogni modo:
Grazie per la guida... credo che invece di aggiungere un nuovo BBCode... a chi non interessa può semplicemente modificare i BBCode per l'installazione/upgrade di Icy Phoenix.
Versione di IP: 3.X
Server: Linux
____________ Luca
-

Mighty Gorgon
-
I wanna love you tender
-
- Età: 37
- Registrato: Maggio 2007
- Residenza: Borgo San Michele
- Messaggi: 1603
-
#5 z3d0 Giovedì, 28 Giugno 2007, 19:03
si ma sinceramente non ho voglia di premere ogni volta SHIFT per scrivere "perché"
-

z3d0
-
VIP

-
- Età: 22
- Registrato: Giugno 2007
- Residenza: TOPICS_TABLE
- Messaggi: 326
-
#6 Imlianot Venerdì, 29 Giugno 2007, 02:02
a be Mighty Gorgon mi sembrerebbe doveroso manterene la parte dello staff di ICY no?
Versione di IP: 1.3.0.53
Server: Linux
-

Imlianot
-
-
- Età: 37
- Registrato: Giugno 2007
- Messaggi: 267
-
#7 Mighty Gorgon Venerdì, 29 Giugno 2007, 02:03
a be Mighty Gorgon mi sembrerebbe doveroso manterene la parte dello staff di ICY no?
In realtà serve per la Hacks List... altrimenti si potrebbe rimuovere...
Versione di IP: 3.X
Server: Linux
____________ Luca
-

Mighty Gorgon
-
I wanna love you tender
-
- Età: 37
- Registrato: Maggio 2007
- Residenza: Borgo San Michele
- Messaggi: 1603
-
#8 zio_gilmor Mercoledì, 17 Ottobre 2007, 10:36
buongiorno a tutti!
Spero di postare nella sezione giusta, altrimenti chiedo venia!
Mi piacerebbe aggiungere un codice BBCODE a quelli già presenti in IP: il BBCODE in questione è una funzione per "tirare dadi per giochi di ruolo" da implementare sul mio forum...
Mi sono trovato di fronte ad un piccolo problema però e non essendo un granchè come programmatore forse è il caso di chiedere un consiglio.
Nel file c'è scritto:
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
Io ho cercato e credo con particolare attenzione ma il file bbcode.tpl non sembra esistere in IP... Esiste invece nel phpbb2 base e in alcuni premodded.
Ho anche cercato il codice da modificare all'interno di bbcode.tpl ma sembra che nessun file di IP contenga il codice richiesto: <!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
Visto che questa modifica è l'unica in quel file, quale file devo modificare al posto di bbcode.tpl?? È chiara la domanda?
Grazie per l'attenzione!
Andrea
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
#9 raphael10 Mercoledì, 17 Ottobre 2007, 14:41
Il codice che vuoi inserire presumo sia per mettere il pulsante relativo al nuovo BBCode (dimmi se sbaglio!?).
In tal caso il file che dovrebbe fare per te è templates/mg_themes/bbcb_mg.tpl (dipende chiaramente anche dal template che usi) e per la posizione bisogna che tu faccia delle prove e vedere cosa si visualizza.
Versione di IP: 1.3.0.53a
Server: Linux
____________ "Non c'è una via per la Pace, la Pace è la Via!"
-

raphael10
-
VIP
 ...uno shamano tra noi...
-
- Età: 40
- Registrato: Maggio 2007
- Residenza: Lucca
- Messaggi: 991
-
#10 zio_gilmor Mercoledì, 17 Ottobre 2007, 17:35
Non sbagli affatto. È una funzione simpatica che voglio introdurre in un PBF.
Grazie per la risposta! Mò ci provo e faccio sapere come è andata!
Andrea
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
#11 zio_gilmor Giovedì, 18 Ottobre 2007, 12:22
Mi è venuto un dubbione riguardo l'installazione di questo mod su IP (non mi è molto chiara la procedura....)
Il file in questione è il seguente:
#################################################################
## MOD Title: Dice BBCode
## MOD Author: Zachary Aerogos < tribalgenesis@hotmail.com > - Zachary Aerogos - http://www.tribalgenesis.no-ip.org
## MOD Original Author: Hades < phpbb@hades.me.uk > - Lee Conlin - http://www.celestialvault.com/blast
## MOD Description: Adds a Dice Roller BBCode for your Forum - THIS MOD REQUIRES THE MULTI-BBCODE MOD!!!
## MOD Version: 1.2.4
##
## Installation Level: Intermediate
## Installation Time: 10 Minutes
## Files To Edit:
## bbcode.php
## posting.php
## templates/*.*bbcode.tpl
## templates/*.*/posting_body.tpl
## language/*.*/lang_main.php
## language/*.*/lang_bbcode.php
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
##
## Author Notes:
##
## BASED ON THE DICE MOD BY Jeff Leigh
##
## IMPORTANT: if you are installing manually (without EasyMod) you MUST first
## install the Multi BBCode MOD available at http://www.phpbb.com/mods/downloads
##
## For serious use of this MOD, you MUST disable non-moderator editing of posts.. otherwise, users
## can simply edit their posts a few times until they get a good roll. Also, if a post is edited (by a
## moderator or user) the word 'Fixed' will appear in the dice roll. This prevents users from 'fixing'
## their results by passing in a result seed they know brings good results... but is nessassary to
## allow a post to be edited without changing the results. I am not quite happy with this, but
## it does the job.
##
## The obvious way to avoid the above issues is to use the Post_ID to seed the results. This,
## however, appeared to require changes to phpbb function declarations - a thing I try very
## hard to avoid (as it can cause problems for other MODs not expecting these changes).
##
## !UPDATED!
##
## This MOD has been bropught to par with the current phpBB specs. and Multi BBCode MOD.
##############################################################
## MOD History:
##
## 2004-12-25 - Version 1.2.4 - Zachary took over development.
## - Updated for phpBB 2.0.7, 2.0.8, 2.0.9, 2.0.10, & 2.0.11
## - Fixed Install Script & Updated To Meet Multi BBCode 1.4.1 Requirements
## - Removed Images Which Were Not Supplied With Original Script From FAQ
##
## 2003-09-16 - Version 1.2.3
## - Updated for phpBB 2.0.6
##
## 2003-08-04 - Version 1.2.2
## - Updated to reflect changes in MOD Template. Dates missing on other version entries due to the fact I can't remember them.
## - Updated code for phpBB 2.0.5
##
## 1.2.1 - Set limits of number of dice and number of sides to prevent silly people from rolling
## dice that would cause fatal errors for reaching max execution time. Neat error message displayed
## instead. - Idea by Wooly Spud
##
## 1.2.0 - Hades took over development.
## - Re-wrote seed generation to give multiple die rolls in the same post different seeds for added randomness.
## This fixed the bug where mutiple occurances of the same roll string within
## a post would all generate identicle results.
## - Removed all dice images. Smaller versions may be added in a later version, but for now they are not needed.
## - Brought this MOD in line with Nutzzy's Multi-BBCode MOD.
## This also eliminates the conflict with the multi-BBCode MOD. =)
##
## 1.1.2 - Jeff Leigh's last release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]---------------------------------
#
$EMBB_widths = array(''
$EMBB_values = array(''
#
#-----[ IN-LINE FIND ]---------------------------------
#
$EMBB_widths = array(''
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'40'
#
#-----[ IN-LINE FIND ]---------------------------------
#
$EMBB_values = array(''
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'Dice'
#
#-----[ FIND ]------------------------------------------
#
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\1', $bbcode_tpl['email']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// --------------------------------
// DICE MOD CODE
// --------------------------------
$bbcode_tpl['dice_open2'] = str_replace('{ROLLED}', $lang['Dice_Mod_Rolled'] . " - \1", $bbcode_tpl['dice_open']);
$bbcode_tpl['dice_open'] = str_replace('{ROLLED}', $lang['Dice_Mod_Rolled'], $bbcode_tpl['dice_open']);
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ FIND ]------------------------------------------
#
// [email]user@domain.tld[/email] code..
$patterns[] = "#[email]([a-z0-9-_.]+?@[w-]+.([w-.]+.)?[w]+)[/email]#si";
$replacements[] = $bbcode_tpl['email'];
$text = preg_replace($patterns, $replacements, $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// --------------------------------
// BEGIN DICE MOD CODE
// --------------------------------
// [dice] tags for rolling dice
$text = bbencode_second_pass_pda($text, "/[dice:$uid]/is", "[/dice:$uid]", 'replace_dice_results', $bbcode_tpl['dice_open'], $bbcode_tpl['dice_close'] );
$text = preg_replace("/[dice:$uid=(?:"?([^"]*)"?)]/si", $bbcode_tpl['dice_open2'] . "[dice:$uid="\1"]", $text);
$text = bbencode_second_pass_pda($text, "/[dice:$uid=(\".*\")]/is", "[/dice:$uid]", 'replace_dice_results', '', $bbcode_tpl['dice_close']);
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ FIND ]------------------------------------------
#
function bbencode_first_pass($text, $uid)
{
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// --------------------------------
// BEGIN DICE MOD CODE
// --------------------------------
function replace_dice_results($text, $uid)
{
global $lang;
// Take the desired Die string ($text) and generate values for each roll.
$Expressions = explode('=', $text);
if( (isset($Expressions[0])) && (isset($Expressions[1])) )
{
$Dice_Rolls = $Expressions[0];
$MT_Seed = intval($Expressions[1]);//(double)microtime()*1000000; doesn't work as it causes the rolls to be re-rolled every time the topic/post is re-loaded//
$Fixed = $Expressions[2];
}
else
{
return;
}
// Make sure we restore the MT gen to a random state after we are done...
$Future_Seed = mt_rand();
mt_srand( $MT_Seed );
$Original_Roll_String = (isset($Fixed)) ? $Dice_Rolls . ' <b><span style="color: #AA0000">' . $lang['Dice_Mod_Fixed'] . '</span></b>': $Dice_Rolls;
$Die_Rolls = explode(' ', trim($Dice_Rolls));
while( $Die = array_shift($Die_Rolls))
{
$footer = '';
$header = '';
$Die_Count = substr($Die,0,strpos($Die,'d'));
$Die_Type = substr($Die,strpos($Die,'d')+1);
if( strpos($Die_Type, '+') )
{
$Method = 1;
$Modifier = substr($Die_Type,strpos($Die_Type,'+')+1);
$Die_Type = substr($Die_Type,0,strpos($Die_Type,'+'));
}
else if( strpos($Die_Type, '-') )
{
$Method = 2;
$Modifier = substr($Die_Type,strpos($Die_Type,'-')+1);
$Die_Type = substr($Die_Type,0,strpos($Die_Type,'-'));
}
else if( strpos($Die_Type, '*') )
{
$Method = 3;
$Modifier = substr($Die_Type,strpos($Die_Type,'*')+1);
$Die_Type = substr($Die_Type,0,strpos($Die_Type,'*'));
}
else if( strpos($Die_Type, 'x') )
{
$Method = 3;
$Modifier = substr($Die_Type,strpos($Die_Type,'x')+1);
$Die_Type = substr($Die_Type,0,strpos($Die_Type,'x'));
}
else if( strpos($Die_Type, '/') )
{
$Method = 4;
$Modifier = substr($Die_Type,strpos($Die_Type,'/')+1);
$Die_Type = substr($Die_Type,0,strpos($Die_Type,'/'));
}
else
{
$Method = 0;
$Modifier = 0;
}
$header = '<b>' . $lang['Dice_Mod_Roll_String'] . '</b>: ' . $Original_Roll_String . '<br /><b>' . $Die_Type . '-Sided Dice Results: </b>';
$footer = '';
$Die_Count = intval($Die_Count);
if( $Die_Count == 0 ) $Die_Count = 1;
$total = 0;
if( $Method )
{
$footer = $footer . "(";
}
// Loop Limit to prevent 500000d500000 sort of dice due to max. execution time limit
if($Die_Count <= 200 && $Die_Type <= 100)
{
for( $i = 0; $i < $Die_Count; $i++ )
{
if( $Die_Type == 100 )
{
$value1 = (integer)(((double)mt_rand()/(double)mt_getrandmax()) * 10) * 10;
$value2 = (integer)(((double)mt_rand()/(double)mt_getrandmax()) * 10);
$total = $total + ($value1 + $value2);
$footer = ($i != $Die_Count - 1) ? $footer . $value1 . '+' . $value2 . '(' .($value1 + $value2) . '<b></b>), ' : $footer . $value1 . '+' . $value2 . '(' . ($value1 + $value2) . '<b></b>)';
}
else
{
$value = (integer)(((double)mt_rand()/(double)mt_getrandmax()) * $Die_Type) + 1;
$total = $total + $value;
$footer = ($i != $Die_Count - 1) ? $footer . $value . ', ' : $footer . $value . '';
}
}
} // Loop limit
else
{
$total = 0;
$Modifier = 0;
$footer = 'Too many dice and/or too many sides';
}
switch( $Method )
{
case 1:
$footer = $footer . '<b></b>) + ' . $Modifier . ' ';
$total = $total + $Modifier;
break;
case 2:
$footer = $footer . '<b></b>) - ' . $Modifier . ' ';
$total = $total - $Modifier;
break;
case 3:
$footer = $footer . '<b></b>) * ' . $Modifier . ' ';
$total = $total * $Modifier;
break;
case 4:
$footer = $footer . '<b></b>) / ' . $Modifier . ' ';
$total = $total / $Modifier;
break;
}
// I do b - /b on purpose... kills out some smilies that crop up.
if( ($Die_Count > 1) || ($Method != 0) )
{
$footer= $footer . ' (<b>Total =</b> ' . $total . '<b></b>)<BR>';
}
else
{
$footer = $footer . '<BR>';
}
$footer = $footer. "";
$results = $results . $header . $footer;
}
// Restore MT randomness
mt_srand($Future_Seed);
return $results;
}
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ FIND ]------------------------------------------
#
// [img]image_url_here[/img] code..
$text = preg_replace("#[img]((ht|f)tp://)([^rnt<"]*?)[/img]#sie", "'[img:$uid]\1' . str_replace(' ', '%20', '\3') . '[/img:$uid]'", $text);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// --------------------------------
// BEGIN DICE MOD CODE
// --------------------------------
$occurances = preg_match_all("#[dice]([-sw+/*]*?)[/dice]#i", $text, $temp);
//list($usec,$sec)=explode(" ",microtime());
mt_srand((double)microtime()*1000000);//$sec * $usec);
// Loop to fix randomness problem of results when multiple die rolls are made in a single post - Hades
for($i=0;$i<=$occurances;$i++)
{
$dice_seed = mt_rand();
$text = preg_replace("#[dice]([-sw+/*]*?)[/dice]#i", "[dice:$uid]\1 = $dice_seed [/dice:$uid] $limit", $text, 1);
$dice_seed = mt_rand();
$text = preg_replace("#[dice=(\\".*?\\")]([-sw+/*]*?)[/dice]#i", "[dice:$uid=\1]\2 = $dice_seed [/dice:$uid] $limit", $text, 1);
}
$text = preg_replace("#[dice]([-sw+/*]*?)=([sd]*?)[/dice]#i", "[dice:$uid]\1 = \2 = Fixed[/dice:$uid]", $text);
$text = preg_replace("#[dice]([-sw+/*]*?)=([sd]*?)=s*?Fixeds*?[/dice]#i", "[dice:$uid]\1 = \2 = Fixed[/dice:$uid]", $text);
$text = preg_replace("#[dice=(\\".*?\\")]([-sw+/*]*?)=([sd]*?)[/dice]#i", "[dice:$uid=\1]\2 = \3 = Fixed[/dice:$uid]", $text);
$text = preg_replace("#[dice=(\\".*?\\")]([-sw+/*]*?)=([sd]*?)=s*?Fixeds*?[/dice]#i", "[dice:$uid=\1]\2 = \3 = Fixed[/dice:$uid]", $text);
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ FIND ]------------------------------------------
#
return $text;
} // bbencode_first_pass_pda()
#
#-----[ AFTER, ADD ]------------------------------------------
#
// --------------------------------
// BEGIN DICE MOD CODE
// --------------------------------
function bbencode_second_pass_pda($text, $open_tag, $close_tag,$func,$open_template, $close_template)
{
$open_tag_count = 0;
$close_tag_length = strlen($close_tag);
$use_function_pointer = ($func && ($func != ''));
$stack = array();
if (is_array($open_tag))
{
if (0 == count($open_tag))
{
// No opening tags to match, so return.
return $text;
}
$open_tag_count = count($open_tag);
}
else
{
// only one opening tag. make it into a 1-element array.
$open_tag_temp = $open_tag;
$open_tag = array();
$open_tag[0] = $open_tag_temp;
$open_tag_count = 1;
}
$open_is_regexp = true;
// Start at the 2nd char of the string, looking for opening tags.
$curr_pos = 1;
while ($curr_pos && ($curr_pos < strlen($text)))
{
$curr_pos = strpos($text, "[", $curr_pos);
// If not found, $curr_pos will be 0, and the loop will end.
if ($curr_pos)
{
// We found a [. It starts at $curr_pos.
// check if it's a starting or ending tag.
$found_start = false;
$which_start_tag = "";
$start_tag_index = -1;
for ($i = 0; $i < $open_tag_count; $i++)
{
// Grab everything until the first "]"...
$possible_start = substr($text, $curr_pos, strpos($text, "]", $curr_pos + 1) - $curr_pos + 1);
//
// We're going to try and catch usernames with "[' characters.
//
if( preg_match('/[quote=\\"/si', $possible_start) && !preg_match('/[quote=\\"[^"]*\\"]/si', $possible_start) )
{
//
// OK we are in a quote tag that probably contains a ] bracket.
// Grab a bit more of the string to hopefully get all of it..
//
$possible_start = substr($text, $curr_pos, strpos($text, ""]", $curr_pos + 1) - $curr_pos + 2);
}
//
// Now compare, either using regexp or not.
$match_result = array();
// PREG regexp comparison.
if (preg_match($open_tag[$i], $possible_start, $match_result))
{
$found_start = true;
$which_start_tag = $match_result[0];
$start_tag_index = $i;
break;
}
}
if ($found_start)
{
// We have an opening tag.
// Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right.
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
bbcode_array_push($stack, $match);
++$curr_pos;
}
else
{
// check for a closing tag..
$possible_end = substr($text, $curr_pos, $close_tag_length);
if (0 == strcasecmp($close_tag, $possible_end))
{
// We have an ending tag.
// Check if we've already found a matching starting tag.
if (sizeof($stack) > 0)
{
// There exists a starting tag.
$curr_nesting_depth = sizeof($stack);
// We need to do 2 replacements now.
$match = bbcode_array_pop($stack);
$start_index = $match['pos'];
$start_tag = $match['tag'];
$start_length = strlen($start_tag);
$start_tag_index = $match['index'];
// everything before the opening tag.
$before_start_tag = substr($text, 0, $start_index);
// everything after the opening tag, but before the closing tag.
$between_tags = substr($text, $start_index + $start_length, $curr_pos - $start_index - $start_length);
// Run the given function on the text between the tags..
if ($use_function_pointer)
{
$between_tags = $func($between_tags, $uid);
}
// everything after the closing tag.
$after_end_tag = substr($text, $curr_pos + $close_tag_length);
// Mark the lowest nesting level if needed.
$text = $before_start_tag . $open_template . $between_tags . $close_template . $after_end_tag;
// Now.. we've screwed up the indices by changing the length of the string.
// So, if there's anything in the stack, we want to resume searching just after it.
// otherwise, we go back to the start.
if (sizeof($stack) > 0)
{
$match = bbcode_array_pop($stack);
$curr_pos = $match['pos'];
bbcode_array_push($stack, $match);
++$curr_pos;
}
else
{
$curr_pos = 1;
}
}
else
{
// No matching start tag found. Increment pos, keep going.
++$curr_pos;
}
}
else
{
// No starting tag or ending tag.. Increment pos, keep looping.,
++$curr_pos;
}
}
}
} // while
return $text;
} // bbencode_second_pass_pda()
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]---------------------------------
#
# NOTE: the full line to look for is:
# 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
#
'L_BBCODE_F_HELP' =>
#
#-----[ AFTER, ADD ]--------------------------------
#
'L_BBCODE_D_HELP' => $lang['bbcode_d_help'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN dice_open -->
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<td><span class="genmed"><b>{ROLLED}:</b></span></td>
</tr>
<tr>
<td class="quote"><!-- END dice_open -->
<!-- BEGIN dice_close --></td>
</tr>
</table>
<span class="postbody"><!-- END dice_close -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]---------------------------------
#
# NOTE: the full line to look for is:
#f_help = "{L_BBCODE_F_HELP}";
#
f_help =
#
#-----[ AFTER, ADD ]---------------------------------
#
d_help = "{L_BBCODE_D_HELP}";
#
#-----[ FIND ]---------------------------------
#
# NOTE: the actual line to find is MUCH longer, containing all the bbcode tags
#
bbtags = new Array(
#
#-----[ IN-LINE FIND ]---------------------------------
#
'[url]','[/url]'
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'[dice]','[/dice]'
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// --------------------------------
// BEGIN DICE MOD CODE
// --------------------------------
$lang['Dice_Mod_Rolled'] ='Dice Roll';
$lang['Dice_Mod_Fixed'] ='Fixed';
$lang['Dice_Mod_Roll_String'] = 'Original Roll String';
$lang['bbcode_d_help'] = 'Roll Dice: [dice]dice string[/dice] (alt-d) Tip: Use the (#)d(Sides) convention.';
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$faq[] = array("--", "Other matters");
$faq[] = array("Can I add my own tags?", "No, I am afraid not directly in phpBB 2.0. We are looking at offering customisable BBCode tags for the next major version");
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// --------------------------------
// BEGIN DICE MOD CODE
// --------------------------------
$faq[] = array("--", "Roleplaying Features");
$faq[] = array("Rolling dice in a post", "Posts and private messages can also include dice rolls. Using the [dice]...[/dice] tags you can specify one or more rolls to be displayed in your message.<br><span style="font-weight: bold">Dice Command Syntax:</span><ul><li>[dice](<span style="font-style: italic">Dice Strings</span>)[/dice]<li>[dice="Roll Title"](<span style="font-style: italic">Dice Strings</span>)[/dice]</ul>The Dice String parameter can include mutliple dice strings in the standard throw syntax.<br /><br /><span style="font-weight: bold">Throw Syntax:</span><ul><li>(<span style="font-style: italic">Number of Dice</span>)d(<span style="font-style: italic">Type of Dice</span>)<li>(<span style="font-style: italic">Number of Dice</span>)d(<span style="font-style: italic">Type of Dice</span>)(<span style="font-style: italic">+,-,x,*,/</span>)(<span style="font-style: italic">Modifier</span>)</ul>It may look complicated if you've never seen this sytem before, but it is actually quite easy to understand.<br /><br />Optionally, you can specify an operation and modifier for each throw, as shown above. Supported operations are addition (+), subtraction (-), multiplication (* or x), and division (/).<br /><br /><span style="font-weight: bold">Some Examples:</span><ul><li>d6 - Throw a single 6-sided die.<li>d20 - Throw a single 20-sided die.<li>2d20 - Throw two 6-sided dice.<li>d100 - Somewhat special, throws two 10 sided die, and multiplies one by 10.. resulting in a range of 100<li>d20+5 - Throw a 20-sided die and add 5 to the result.<li>4d20+10 - Throw four 20-sided dice and add 10 to the total.</ul>Hopefully you understand.<br /><br /><span style="font-weight: bold">Output Examples:</span><br /><br />Here are a few instances of the 'Die' code in action, with the code above. <br />Totals are provided for convience, but obviously are not relevent to all throws.<br /><br /><span style="font-weight: bold">Code:</span> [dice]d20[/dice]<br /><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> <td><span class="genmed"><b>Dice Roll:</b></span></td></tr><tr><td class="quote"><b>Original Roll String:</b> <font color="#000088">d20</font><BR><BR><b>20-Sided Dice Results: </b>6<BR><div align="center"><center><table border="0" width="80%" bgcolor="#FFFFFF" cellspacing="0"><tr><td width="100%"></td></tr></table></center></div></td></tr></table><span class="postbody"><br /><span style="font-weight: bold">Code:</span> [dice="Fire Save"]2d20+10[/dice]<br /><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr><td><span class="genmed"><b>Dice Roll - Fire Save:</b></span></td></tr><tr><td class="quote"><b>Original Roll String:</b> <font color="#000088">2d20+10</font><BR><BR><b>20-Sided Dice Results: </b>(4, 1<b></b>) + 10 (<b>Total =</b> 15<b></b>)<BR><div align="center"><center><table border="0" width="80%" bgcolor="#FFFFFF" cellspacing="0"><tr><td width="100%"></td></tr></table></center></div></td></tr></table><span class="postbody"><br /><span style="font-weight: bold">Code:</span> [dice="Statistic Generation"]4d4+10 3d6x2 2d100 4d4+10[/dice]<br /><table width="90%" cellspacing="1" cellpadding="3" border="0" align="center"><tr><td><span class="genmed"><b>Dice Roll - Statistic Generation:</b></span></td></tr><tr><td class="quote"><b>Original Roll String:</b> <font color="#000088">d4+10 3d6x2 2d100 4d4+10</font><BR><BR><b>4-Sided Dice Results: </b>(2<b></b>) + 10 (<b>Total =</b> 12<b></b>)<BR><div align="center"><center><table border="0" width="80%" bgcolor="#FFFFFF" cellspacing="0"><tr><td width="100%"><img src="./images/dice/white/dice_4_sided_2.jpg"></td></tr></table></center></div><b>6-Sided Dice Results: </b>(1, 4, 3<b></b>) * 2 (<b>Total =</b> 16<b></b>)<BR><div align="center"><center><table border="0" width="80%" bgcolor="#FFFFFF" cellspacing="0"><tr><td width="100%"></td></tr></table></center></div><b>100-Sided Dice Results: </b>60+1(61<b></b>), 30+1(31<b></b>) (<b>Total =</b> 92<b></b>)<BR><div align="center"><center><table border="0" width="80%" bgcolor="#FFFFFF" cellspacing="0"><tr><td width="100%"></td></tr></table></center></div><b>4-Sided Dice Results: </b>(1, 3, 4, 1<b></b>) + 10 (<b>Total =</b> 19<b></b>)<BR><div align="center"><center><table border="0" width="80%" bgcolor="#FFFFFF" cellspacing="0"><tr><td width="100%"></td></tr></table></center></div></td></tr></table><span class="postbody"><br /><br />In case you are wondering, the numbers you see when you 'preview' will probably change when you go to post.<BR><BR><i>Dice Mod (version 1.1.0) by Jeff Leigh.</i>");
// --------------------------------
// END DICE MOD CODE
// --------------------------------
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Non è che qualcuno, con santa pazienza, può darmi una mano ad installarlo su IP?  Grazie!!
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
#12 raphael10 Giovedì, 18 Ottobre 2007, 14:10
In effetti non si tratta di installare solo questa MOD, nell'intro c'è infatti scritto che è necessario che nel forum si già stata installata anche la Multi-BBCode Mod
Citazione: THIS MOD REQUIRES THE MULTI-BBCODE MOD!!!
Versione di IP: 1.3.0.53a
Server: Linux
____________ "Non c'è una via per la Pace, la Pace è la Via!"
-

raphael10
-
VIP
 ...uno shamano tra noi...
-
- Età: 40
- Registrato: Maggio 2007
- Residenza: Lucca
- Messaggi: 991
-
#13 zio_gilmor Domenica, 21 Ottobre 2007, 14:30
Mi sembra che sia cambiato poco, il problema di base rimane e se non ho malinterpretato, il problema è che i vari MOD sono stati creati per una installazione "vanilla" di phpBB e la cosa mi crea problemi, essendo n00b....
Posso postare qui entrambi i MOD per vedere se qualcuno può darmi una mano ad installarli su IP?
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
#14 raphael10 Domenica, 21 Ottobre 2007, 17:04
Magari sentiamo anche l'opinione di MG - o di altre persone dello Staff - ho notato che sui BBCode ci sono già varie MOD installate, non vorrei che si facesse troppa confusione o che il tutto diventi troppo complesso da installare!
Versione di IP: 1.3.0.53a
Server: Linux
____________ "Non c'è una via per la Pace, la Pace è la Via!"
-

raphael10
-
VIP
 ...uno shamano tra noi...
-
- Età: 40
- Registrato: Maggio 2007
- Residenza: Lucca
- Messaggi: 991
-
#15 zio_gilmor Domenica, 21 Ottobre 2007, 17:27
È quello il problema... L'ho installato su phpbb senza sforzo e funziona... Ma dato che vorrei migrare l'attuale forum verso IP, sarebbe un bonus mica da ridere, visto che c'è già un PBF e ho intenzione di farne partire un altro paio...
Comunque attendo infos. Grazie!
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
#16 Mighty Gorgon Martedì, 23 Ottobre 2007, 10:36
Ti ho modificato il messaggio mettendo uno spoiler.
Per favore non incollate testi così lunghi nei messaggi, che nessuno li legge. Attaccate file di testo piuttosto.
Nella prossima versione avrai un generatore di numeri casuali tra i BBCode... ma non funziona come il DICE perché aggiorna il numero ogni volta che ricarichi la pagina.
Versione di IP: 3.X
Server: Linux
____________ Luca
-

Mighty Gorgon
-
I wanna love you tender
-
- Età: 37
- Registrato: Maggio 2007
- Residenza: Borgo San Michele
- Messaggi: 1603
-
#17 raphael10 Martedì, 23 Ottobre 2007, 15:07
Senti zio_gilmor con tanta caaaaaalma e pazienza
posso vedere di testare l'installazione di entrambe le MOD su IP, un po' perchè sinceramente sono curioso di vedere il risultato e mi è venuta l'idea che il Dice BBCode potrebbe essere utilizzato oltre che in maniera strettamente ludica anche per creare una sorta di "gioco educativo-evolutivo" nell'ambito della crescita personale.
Chiaramente se funziona il tutto apro un post apposito per spiegare i passaggi!
Incrocia le dita!.....
Versione di IP: 1.3.0.53a
Server: Linux
____________ "Non c'è una via per la Pace, la Pace è la Via!"
-

raphael10
-
VIP
 ...uno shamano tra noi...
-
- Età: 40
- Registrato: Maggio 2007
- Residenza: Lucca
- Messaggi: 991
-
#18 zio_gilmor Mercoledì, 24 Ottobre 2007, 09:37
Ok. Chiedo venia per l'incollatura chilometrica...
Raphael, a parte il fatto che ora sono in fibrillazione ventricolare continua ed ho una damigiana di valium collegata direttamente alla giugulare  (birra pagata se fai cotanto lavoro, promessa dello zio!) ma potresti dettagliarmi un pochino di più cosa intendi con
Citazione: creare una sorta di "gioco educativo-evolutivo" nell'ambito della crescita personale.
Mi hai incuriosito
ZG
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
#19 raphael10 Mercoledì, 24 Ottobre 2007, 14:30
Alla tua domanda ti ho risposto qua: http://www.icyphoenix.it/viewtopic.php?p=6650
Per quanto riguarda le MOD non ho ancora avuto tempo ma in giornata cerco di iniziare a dedicarmici.
------------------
EDIT:
la cosa è ben più complessa del previsto (almeno per me) e quindi non garantisco nessun risultato positivo,
ad ogni modo continuo a fare delle prove, il problema è che le funzioni dei BBCode di ICY sono troppo diverse da PhpBB base...
Versione di IP: 1.3.0.53a
Server: Linux
____________ "Non c'è una via per la Pace, la Pace è la Via!"
-

raphael10
-
VIP
 ...uno shamano tra noi...
-
- Età: 40
- Registrato: Maggio 2007
- Residenza: Lucca
- Messaggi: 991
-
#20 zio_gilmor Giovedì, 25 Ottobre 2007, 00:02
Mi rode che non ho le competenze per poterti aiutare... Neanche conosco persone con le conoscenze adatte da affiancare al tuo lavoro.
Versione di IP: 1.3.0.53a
Server: Linux
____________ Zio Gilmor
-

zio_gilmor
-
Frequentatore

-
- Età: 42
- Registrato: Ottobre 2007
- Residenza: Una spettacolare LinuxBox a Milano City
- Messaggi: 139
-
Questo argomento è stato utile?
Questo argomento è stato utile?
| Condividi Argomento |
|
 | | Inserisci un link per questo argomento |
| URL |
|
| BBCode |
|
| HTML |
|
Argomenti Simili
Argomenti Simili
| Argomento |
Autore |
Forum |
Risposte |
Ultimo Messaggio |
 |
[mod] Bbcode Per Moderatori
|
festival |
Archivio 'Icy Phoenix MODifiche' |
2 |
Giovedì, 25 Ottobre 2007, 09:30  festival |
 |
Aggiungere Menu' Al Forum.
|
grizzly |
Archivio 'Supporto Generale' |
4 |
Giovedì, 27 Marzo 2008, 09:48  hpl |
 |
Aggiungere Pulsante Nel Forum
|
iffty |
Supporto Generale |
4 |
Sabato, 17 Ottobre 2009, 07:11  iffty |
 |
Bbcode Hide
|
enzodok86 |
Icy Phoenix MODifiche |
3 |
Giovedì, 05 Agosto 2010, 03:52  raphael10 |
 |
Script Musica Di Sottofondo Sul Vostro Forum
|
sitael |
Icy Phoenix MODifiche |
2 |
Giovedì, 27 Gennaio 2011, 23:30  Andrea75 |
Lista Permessi
|
Non puoi inserire nuovi Argomenti Non puoi rispondere ai Messaggi Non puoi modificare i tuoi Messaggi Non puoi cancellare i tuoi Messaggi Non puoi votare nei Sondaggi Non puoi allegare files Non puoi scaricare gli allegati Non puoi inserire eventi calendario
|
|
|
|
|