Instalação Dicemod 0.8.8b

Suporte à dúvidas gerais relacionadas ao phpBB.
victorflamel
Novato
Novato
Mensagens: 4
Registrado em: 10 Ago 2012, 12:51

Instalação Dicemod 0.8.8b

Mensagem por victorflamel »

Qual a URL do seu fórum: http://www.forcanerd.com/forum
Tipo de Hospedagem: Pago
Qual a versão do phpBB: phpBB 3.0.10
É um novo ou uma conversão: Instalação Limpa
Usuário de teste: Usuário: naotem Senha: naotem
Estilos instalados: static
Modificações instaladas: nenhuma
Qual seu nivel de experiência: Iniciante
Quando começou o problema: ainda não começou
Descreva seu problema: Sou novo em phpBB e estou fazendo um fórum para meu site.
Um dos meus membros me pediu esse mod para mobilizar uma categoria.

Encontrei esse mod dicemod 0.8.8b acho que o mais completo nesse sentido de rolagem de dados para RPG.
COmo sou novo fiquei perdido em que arquivos enviar. Como proceder alguém pode me ajudar nisso?

http://prntscr.com/dk1v4
Editado pela última vez por victorflamel em 10 Ago 2012, 13:15, em um total de 1 vez.
Avatar do usuário
_Vinny_
Administrador
Administrador
Mensagens: 5971
Registrado em: 03 Set 2009, 21:59
Contato:

Re: Instalação Dicemod 0.8.8b

Mensagem por _Vinny_ »

Tradução Português Brasileiro: https://www.phpbb.com/customise/db/translation/brazilian_portuguese/

Precisa de serviços phpBB? Me mande um mensagem privada ou visite https://vinny.quest
victorflamel
Novato
Novato
Mensagens: 4
Registrado em: 10 Ago 2012, 12:51

Re: Instalação Dicemod 0.8.8b

Mensagem por victorflamel »

Tópico arrumado
Micael
Novato
Novato
Mensagens: 69
Registrado em: 28 Jan 2005, 03:35
Localização: Rio Preto - SP

Re: Instalação Dicemod 0.8.8b

Mensagem por Micael »

victorflamel ,

Acredito que esse Artigo vai te ajudar a instalar:
kb.php?a=2

Qualquer dúvida é só postar.

Abraços,
Micael
victorflamel
Novato
Novato
Mensagens: 4
Registrado em: 10 Ago 2012, 12:51

Re: Instalação Dicemod 0.8.8b

Mensagem por victorflamel »

Micael, eu já tinha lido esse tópico mais to perdido no que mando p servidor ou não aqui tenho assim as pastas:

language
root
styles
update
-install
-license
-modx.prosilver.en
Micael
Novato
Novato
Mensagens: 69
Registrado em: 28 Jan 2005, 03:35
Localização: Rio Preto - SP

Re: Instalação Dicemod 0.8.8b

Mensagem por Micael »

victorflamel,

Os arquivos que você tem que enviar para o servidor são os que estão dentro da pasta root, lembrando de enviar para as respectivas pastas.

Abraços,
Micael
Avatar do usuário
_Vinny_
Administrador
Administrador
Mensagens: 5971
Registrado em: 03 Set 2009, 21:59
Contato:

Re: Instalação Dicemod 0.8.8b

Mensagem por _Vinny_ »

victorflamel, tudo que esta dentro do diretorio root deve ser enviado para a instalação do seu phpBB3.

Todas as instruções você ler no arquivo install.xml contido no pacote da MOD.
Tradução Português Brasileiro: https://www.phpbb.com/customise/db/translation/brazilian_portuguese/

Precisa de serviços phpBB? Me mande um mensagem privada ou visite https://vinny.quest
victorflamel
Novato
Novato
Mensagens: 4
Registrado em: 10 Ago 2012, 12:51

Re: Instalação Dicemod 0.8.8b

Mensagem por victorflamel »

Tudo que tem no install ae

Código: Selecionar todos

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--For security purposes, please check: http
://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>

		<title lang="en">Dicemod</title>

		<description lang="en">A dice rolling mod for forum RPGs.</description>

		<author-notes lang="en">This mod was written in response to a request on the phpbb forums. Feel free to suggest any new features. Warning: This is an experimental version. Do not install if you can not tolerate damage done to posts using dice bbcodes.</author-notes>

		<author-group>
			<author>
				<realname>Patrick Riedel</realname>
				<username>MalkContent</username>
				<homepage>http://sinister-lore.de</homepage>
      		<contributions-group>
      		  <contributions status="current" from="2009-10-10" position="Developer"/>
      		</contributions-group>
			</author>
			<author>
				<realname>Todd Schumann</realname>
				<username>surfer247</username>
      		<contributions-group>
      		  <contributions status="past" from="unknown" to="2009-10-10" position="Developer"/>
      		</contributions-group>
			</author>
		</author-group>

		<mod-version>0.8.8b</mod-version>

		<installation>
			<level>intermediate</level>
			<time>1800</time>
			<target-version>3.0.10</target-version>
		</installation>

		<history>
			<entry>
				<date>2012-06-04</date>
				<rev-version>0.8.8b</rev-version>
				<changelog lang="en">
						<change>added a crucial forgotten line to install instructions that prevented the mod from working at all</change>
						<change>small bugfix to posting.php which caused empty array errors</change>
						<change>fixed dicemod acp module php</change>
				</changelog>
			</entry>
			<entry>
				<date>2012-06-04</date>
				<rev-version>0.8.8</rev-version>
				<changelog lang="en">
						<change>a number of little Bugs found and fixed</change>
						<change>fixed Bug that prevented usage of ' in posts containing dicerolls</change>
						<change>rearranged Code</change>
						<change>made Mathparsing Depth available for configuration in ACP</change>
						<change>created "default dicemode" as a forum option</change>
						<change>replaced the modes total and totalonly with combinable modes string and total</change>
						<change>if only the total is displayed, the bbcode replacement now shows the diceroll as hovertext</change>
				</changelog>
			</entry>
			<entry>
				<date>2012-05-07</date>
				<rev-version>0.8.4b</rev-version>
				<changelog lang="en">
						<change>Bugfixes only</change>
						<change>fixed Smileys causing SQL errors and disabling usage of dicecode in posts containing Smileys</change>
						<change>fixed error causing posting posts to result empty posts or sql errors in forum that did not allow dice at all</change>
				</changelog>
			</entry>
			<entry>
				<date>2012-01-23</date>
				<rev-version>0.8.4</rev-version>
				<changelog lang="en">
						<change>repaired math parsing</change>
						<change>put dicemod version number into the db</change>
				</changelog>
			</entry>
			<entry>
				<date>2012-01-21</date>
				<rev-version>0.8.3</rev-version>
				<changelog lang="en">
						<change>fixed bug: broken dice quotes in new posts created via quote button</change>
						<change>enabled preview without dice bbcode parsing</change>
						<change>enabled disabling of dice bbcode by disabling bbcode in a post</change>
						<change>enabled disabling dice bbcode parsing by placing it within [code]
bbcode</change>
<change>hopefully fixed issue with dice rolls being assinged wrong post_ids</change>
</changelog>
</entry>
<entry>
<date>2011-07-05</date>
<rev-version>0.8.1</rev-version>
<changelog lang="en">
<change>Added a math parser.</change>
<change>Supports addition, substraction, multiplication and division of float values.</change>
<change>Supports only one calculation in one bracket set.</change>
<change>Supports negative numbers.</change>
<change>The dice roll must be in the deepest bracket layer.</change>
<change>The function is simply written around the standard rolling code</change>
<change>Using a function automatically displays the total value, no need for the total tag</change>
<change>Example: [dice]10/(3d20+3)*-2.5)[/dice]</change>
<change>To change the function on an existing roll, do as with the previous example, but surround the roll id with f( )</change>
<change>Example: [dice]10/f(0)*-2.5)[/dice]</change>
<change>To remove a function from a dice roll, surround the roll id with nomath( )</change>
<change>Example: [dice]nomath(0)[/dice]</change>
<change>Changed the way missing or redundant roll ids are handled durin posting:</change>
<change>Missing dice rolls are added at the bottom of the post</change>
<change>Redundant dice rolls are removed, only the first code is kept.</change>
<change>Significant refining changes to old code.</change>
</changelog>
</entry>
<entry>
<date>2011-06-30</date>
<rev-version>0.7.3</rev-version>
<changelog lang="en">
<change>Added roll crafting.</change>
<change>I.e. to craft 3 rolls of a d6 resulting in 2,1 and 6, post [dice]d6:2,1,6[/dice].</change>
<change>You can't produce illegal rolls exceeding the selected die's max pips or the max dice-count.</change>
<change>Crafting dice rolls requires permission of the moderator permission set.</change>
<change>Tiny refining changes to old code.</change>
<change>Updated version number displayed in the APC module. I won't miss updating that one again...</change>
</changelog>
</entry>
<entry>
<date>2010-04-08</date>
<rev-version>0.7.2</rev-version>
<changelog lang="en">
<change>All bugfixes.</change>
<change>Added missing acp language file entries.</change>
<change>Corrected wrong database column name of the v0.7.1 install version (doesn't affect people who updated to v0.7.1 from 0.5.0).</change>
</changelog>
</entry>
<entry>
<date>2010-03-29</date>
<rev-version>0.7.1</rev-version>
<changelog lang="en">
<change>Removed a minor bug regarding the quote-post-button.</change>
<change>Re-added the totalonly tag.</change>
<change>Reformatted large sections of the code.</change>
<change>Did some minor code improvements</change>
<change>Added permission settings for fora and users/groups in fora.</change>
<change>Reworked the ACP Module.</change>
<change>Added semi-autodetect for available dice themes.</change>
</changelog>
</entry>
<entry>
<date>2009-12-06</date>
<rev-version>0.5.0</rev-version>
<changelog lang="en">
<change>Added ACP module.</change>
<change>Refined code segments.</change>
<change>Renamed dice images for more significance and relocated them. Adapted Code.</change>
</changelog>
</entry>
<entry>
<date>2009-11-22</date>
<rev-version>0.4.5</rev-version>
<changelog lang="en">
<change>Fixed critical bug which prevented usage of any display modes.</change>
<change>Fixed issue with text mode only being displayed in Firefox Browsers.</change>
<change>Rewrote installation instructions to fit phpbb 3.0.6</change>
<change>No update instructions to prevent bugs being carried through updates. Also I don't have the time this time.</change>
</changelog>
</entry>
<entry>
<date>2009-11-08</date>
<rev-version>0.4.4</rev-version>
<changelog lang="en">
<change>Added UCP frontend.</change>
<change>Refined parsing of the bbcode.</change>
<change>Added database entry for the allowed dice.</change>
<change>Added 'Bajahs Red' dice-skin, renamed 'stock'-skin to 'Classic Steel'.</change>
<change>Minor bug regarding the parsing bbcode for existing rolls corrected.</change>
</changelog>
</entry>
<entry>
<date>2009-10-18</date>
<rev-version>0.3.7</rev-version>
<changelog lang="en">
<change>Changed the way the text like (USER rolled X Y-sided dice) in front of the actual dice roll was parsed in the bbcode.php to ease the translation and make the languagefile entries less confusing.</change>
<change>Put in a small prevention against rolling new Dice via [dice]NumberNumber[/dice] for users using language packs without a set DICE_CHAR in language/*/common.php. If no DICE_CHAR is defined, the BBCode requires the english 'd' between the numbers.</change>
<change>Made quoting via Quote-Button automatically insert the 'post_id:' in front of the roll_id: [dice]0[/dice] in the original Post with post_id = 254 -> [dice]254:0[/dice]</change>
<change>Minor bug regarding the limit of allowed dice rolls per post corrected.</change>
<change>Changed the location of the code segment responsible for deleting dice rolls on post deletion to grant greater consistency.</change>
<change>Removed useless code segment from bbcode.php and built in a small method so that [dice][/dice] isn't parsed as [dice]0[/dice] anymore.</change>
<change>Added langfile entries for quoted rolls former "Original post:" prefix and made it depending on users language.</change>
</changelog>
</entry>
<entry>
<date>2009-10-10</date>
<rev-version>0.3.0</rev-version>
<changelog lang="en">
<change>Seemingly abandoned mod overtaken by MalkContent.</change>
<change>Fixed some bugs, made the mod more consistent and lightweight database-wise.</change>
<change>Changed way of identification of dice rolls to be more intuitive.</change>
<change>Removed the ACP module in favor of language files. Ability to remove dice still controllable by permissions.</change>
<change>Added images for common dice.</change>
<change>Version number went back to 0.3.0 as I consider it working yet incomplete.</change>
</changelog>
</entry>
<entry>
<date>2008-09-11</date>
<rev-version>2.0.0</rev-version>
<changelog lang="en">
<change>Rewrote a lot of the original mod functionality.</change>
<change>Added more security to the removability option.</change>
<change>Added functionality to dice rolls outside of their respective posts (also fixes the quote issue).</change>
<change>Added an ACP module to control the settings.</change>
</changelog>
</entry>
<entry>
<date>2008-07-23</date>
<rev-version>1.2.1</rev-version>
<changelog lang="en">
<change>Updated the installation file to MODX 1.2.0</change>
</changelog>
</entry>
<entry>
<date>2008-07-22</date>
<rev-version>1.2.0</rev-version>
<changelog lang="en">
<change>Added features to prevent a normal user from changing the dice rolls.</change>
<change>Added features to let moderators and administrators delete the rolls.</change>
<change>Added a database table to keep track of all the dice rolls and whether they may be deleted by the user.</change>
</changelog>
</entry>
<entry>
<date>2008-07-21</date>
<rev-version>1.0.0</rev-version>
<changelog lang="en">
<change>Completed a simple dice roll BBCode.</change>
</changelog>
</entry>
</history>

</header>

<action-group>

<copy>
<file from="root/updateDatabase.php" to="updateDatabase.php" />
<file from="root/adm/style/acp_dicemod.html" to="adm/style/acp_dicemod.html" />
<file from="root/adm/style/dice_selectbox.js" to="adm/style/dice_selectbox.js" />
<file from="root/dicemod/dice_functions.php" to="dicemod/dice_functions.php" />
<file from="root/dicemod/dice_functions_posting.php" to="dicemod/dice_functions_posting.php" />
<file from="root/dicemod/skins/bajahs red/*.*" to="dicemod/skins/bajahs red/*.*" />
<file from="root/dicemod/skins/classic steel/*.*" to="dicemod/skins/classic steel/*.*" />
<file from="root/includes/acp/acp_dicemod.php" to="includes/acp/acp_dicemod.php" />
<file from="root/includes/acp/info/acp_dicemod.php" to="includes/acp/info/acp_dicemod.php" />
<file from="root/language/en/mods/*.*" to="language/en/mods/*.*" />
</copy>

<open src="posting.php">
<edit>
<comment lang="en">Create dice rolls; delete missing dice rolls if permitted, add missing dicerolls at the end of the post, if not permitted; remove diceroll doubles</comment>
<find><![CDATA[include($phpbb_root_path . 'includes/message_parser.' . $phpEx);]]></find>
<action type="after-add"><![CDATA[/*
BEGIN DICEMOD
*/
include($phpbb_root_path . 'dicemod/dice_functions_posting.' . $phpEx);
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Create dice rolls; delete missing dice rolls if permitted, add missing dicerolls at the end of the post, if not permitted; remove diceroll doubles</comment>
<find><![CDATA[ // The last parameter tells submit_post if search indexer has to be run
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
$sql = 'SELECT * FROM '. FORUMS_TABLE . ' WHERE forum_id=' . $data['forum_id'];
$result = $db->sql_query($sql);
if($result)
{
$row = $db->sql_fetchrow($result);
if($row['forum_allow_dice'])
{
$dmessage = $message_parser->message;
if(($row['forum_allow_dice']==2) || $auth->acl_get('f_allow_dice', $data['forum_id']))
{
//add new dice codes
$dmessage = preg_replace('#\[dice(=([^\]]*))?:' . $message_parser->bbcode_uid . '\]((.*?))\[/dice:' . $message_parser->bbcode_uid . '\]#ise' , "encodediceBBCode('\$2','\$3',\$data['post_id'], \$data['forum_id'], \$message_parser->bbcode_uid)" , $dmessage);
}
//Make the dice code permanent,
//check on the existing dice codes
//grab all the dice codes for this post
$sql = 'SELECT * FROM ' . DICE_TABLE . ' WHERE post_id=' . $data['post_id'];
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
$carrydmatch = false;
$offset = 0;
$carryarr = NULL;
//is the dice code not present in the message?
do{
$carrydmatch = preg_match('#\[dice(=([^\]]*))?' . ($data['enable_bbcode']? ':' . $message_parser->bbcode_uid : '') . '\]('.$row['roll_id'].')\[/dice' . ($data['enable_bbcode']? ':' . $message_parser->bbcode_uid : '') . '\]#ise', $dmessage, $carryarr, PREG_OFFSET_CAPTURE, $offset);
if($carrydmatch)
$dmode_set = checkDiceModes($carryarr[2][0]);
$offset = $carryarr[0][1]+strlen($carryarr[0][0]);
}while($carrydmatch && (!$dmode_set["valid"] || $dmode_set["quote"])); //loop as long as dice code is found, but with invalid tags/quote tag; dice code quoted with [dice]post_id:roll_id[/dice]] are already unaffected due to the pattern

if(!$carrydmatch)
{
//if the user does not have the permissions to remove it, add the dice code at the end of the post
if(!$row['can_remove'] && !$auth->acl_get('m_', $data['forum_id']))
{
$dmessage = $dmessage . "\n" . '[dice' . ($data['enable_bbcode']? ':' . $message_parser->bbcode_uid : '') . ']' . $row['roll_id'] . '[/dice' . ($data['enable_bbcode']? ':' . $message_parser->bbcode_uid : '') . ']';
}
else{
//otherwise, the dice has been removed and remove it from the database for cleanup
$sql = 'DELETE FROM ' . DICE_TABLE . ' WHERE id=' . $row['id'];
$db->sql_query($sql);
}
}
else{ //remove roll doubles
$carrydmatch = false;
$carryarr = NULL;
do{
$carrydmatch = preg_match('#\[dice(=([^\]]*))?' . ($data['enable_bbcode']? ':' . $message_parser->bbcode_uid : '') . '\]('.$row['roll_id'].')\[/dice' . ($data['enable_bbcode']? ':' . $message_parser->bbcode_uid : '') . '\]#ise', $dmessage, $carryarr, PREG_OFFSET_CAPTURE, $offset);
if($carrydmatch){
$dmode_set = checkDiceModes($carryarr[2][0]);
if($dmode_set["valid"] && !$dmode_set["quote"])
$dmessage = substr($dmessage, 0, $carryarr[0][1]) . substr($dmessage, $carryarr[0][1]+strlen($carryarr[0][0]));
else
$offset = $carryarr[0][1]+strlen($carryarr[0][0]);
}
}while($carrydmatch); //loop as long as dice code is found, replace if it is valid and not quote.
}
}
$db->sql_freeresult($result);

$dmessage = str_replace("'", "\\'", $dmessage);
$message_parser->message = $dmessage;
$sql = 'UPDATE ' . POSTS_TABLE . ' SET post_text = \'' . $message_parser->message . '\', post_checksum = "' . md5($message_parser->message) . '" WHERE post_id = ' . $data['post_id'];
$db->sql_query($sql);
}
}
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">If a post is quoted via Quote-Button, add post_id to the dice rolls of the quoted post.</comment>
<find><![CDATA[ else
{
$offset = 0;
$quote_string = "> ";
$message = censor_text(trim($message_parser->message));
// see if we are nesting. It's easily tricked but should work for one level of nesting
if (strpos($message, ">") !== false)
{
$offset = 10;
}
$message = utf8_wordwrap($message, 75 + $offset, "\n");

$message = $quote_string . $message;
$message = str_replace("\n", "\n" . $quote_string, $message);
$message_parser->message = $post_data['quote_username'] . " " . $user->lang['WROTE'] . ":\n" . $message . "\n";
}]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
$sql = 'SELECT * FROM ' . DICE_TABLE . ' WHERE post_id=' . $post_data['post_id'];
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if($row)
$message_parser->message = preg_replace('#\[dice([=][A-z,]*)?\]([0-9]+)\[/dice\]#ise' , "'[dice\$1]". $post_data['post_id'] . ":\$2[/dice]'" , censor_text(trim($message_parser->message)));
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="viewtopic.php">
<edit>
<comment lang="en">If the GET variables associated with changing the removability, retreive them.</comment>
<find><![CDATA[$update = request_var('update', false);]]></find>
<action type="after-add"><![CDATA[/*
BEGIN DICEMOD
*/
$removability = request_var('removability', -1);
$diceID = request_var('diceID', -1);
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">If the removability variables have been set and the user has moderator privileges, call the function to change the removability.</comment>
<find><![CDATA[$forum_id = (int) $topic_data['forum_id'];]]></find>
<action type="after-add"><![CDATA[/*
BEGIN DICEMOD
*/
if($removability >= 0 && $diceID >= 0 && $auth->acl_get('m_', $forum_id))
{
require_once($phpbb_root_path . 'dicemod/dice_functions.' . $phpEx);
setremovability($diceID, $removability);
}
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="adm/style/acp_forums.html">
<edit>
<comment lang="en">Add radiobuttons for forum permission setting.</comment>
<find><![CDATA[ <dl>
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
<dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd>
</dl>]]></find>
<action type="after-add"><![CDATA[ <dl>
<dt><label for="forum_allow_dice">{L_FORUM_ALLOW_DICE}:</label><br /><span>{L_FORUM_ALLOW_DICE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="forum_allow_dice" value="2"<!-- IF S_ALLOW_DICE == 2 --> id="forum_allow_dice" checked="checked"<!-- ENDIF --> /> {L_DICE_ALWAYS}</label>
<label><input type="radio" class="radio" name="forum_allow_dice" value="1"<!-- IF S_ALLOW_DICE == 1 --> id="forum_allow_dice" checked="checked"<!-- ENDIF --> /> {L_DICE_DEPENDS}</label>
<label><input type="radio" class="radio" name="forum_allow_dice" value="0"<!-- IF S_ALLOW_DICE == 0 --> id="forum_allow_dice" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="forum_allow_dice">{L_FORUM_DICE_DEFAULT_MODE}:</label><br /><span>{L_FORUM_DICE_DEFAULT_MODE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="forum_default_dice_mode" value="1"<!-- IF S_DEFAULT_DICE_MODE == 1 --> id="forum_default_dice_mode" checked="checked"<!-- ENDIF --> /> {L_DICE_STRING}</label>
<label><input type="radio" class="radio" name="forum_default_dice_mode" value="2"<!-- IF S_DEFAULT_DICE_MODE == 2 --> id="forum_default_dice_mode" checked="checked"<!-- ENDIF --> /> {L_DICE_TOTAL}</label>
<label><input type="radio" class="radio" name="forum_default_dice_mode" value="3"<!-- IF S_DEFAULT_DICE_MODE == 3 --> id="forum_default_dice_mode" checked="checked"<!-- ENDIF --> /> {L_DICE_STRING_TOTAL}</label></dd>
</dl>]]></action>
</edit>
</open>

<open src="includes/bbcode.php">
<edit>
<comment lang="en">Since this BBCode requires more than just an HTML replacement, we need to manually add the dice case to the bbcode list.</comment>
<find><![CDATA[ case 12:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[/attachment:$uid]' => $this->bbcode_tpl('inline_attachment_close', $bbcode_id)
),
'preg' => array(
'#\[attachment=([0-9]+):$uid\]#' => $this->bbcode_tpl('inline_attachment_open', $bbcode_id)
)
);
break;]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
case DICE_BBCODE_ID:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[dice:$uid\](([0-9]+:)?[0-9]+)\[/dice:$uid\]#ise' => "\$this->decodedice('\$1','')",
)
);
break;

case DICE_ACTION_BBCODE_ID:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[dice=(.*?)\:$uid\](([0-9]+:)?[0-9]+)\[/dice:$uid\]#ise' => "\$this->decodedice('\$2','\$1')",
)
);
break;
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Add the function to process the dice BBCode to the bbcode file.</comment>
<find><![CDATA[}

?>]]></find>
<action type="before-add"><![CDATA[ /*
BEGIN DICEMOD
*/
function decodedice($roll_code, $modes)
{
global $db, $user, $auth, $forum_id, $row, $config;

if($row['post_id']){
//identify dice roll
if(substr_count($roll_code, ":") > 0)
{
$pos = strrpos($roll_code, ":");
$post_id = (int)substr($roll_code, 0, $pos);
$roll_id = (int)substr($roll_code, $pos +1);
}
else
{
$post_id = $row['post_id'];
/*if($rollcode === ""){
return $user->lang['INVALID_DICE_CODE'];
}
else{
$roll_id = (int)$roll_code;
}*/
$roll_id = (int)$roll_code;
if(($roll_id == 0) AND ($roll_code!='0')){
return $user->lang['INVALID_DICE_CODE'];
}
}

//get the dice roll from the database
$sql = 'SELECT * FROM ' . DICE_TABLE . ' WHERE (post_id =' . $post_id . ' AND roll_id =' . $roll_id . ')';
$result = $db->sql_query($sql);
$dice_roll = $db->sql_fetchrow($result);
if(!$dice_roll){
return $user->lang['INVALID_DICE_CODE'];
}

require_once(((defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './') . 'dicemod/dice_functions.' . substr(strrchr(__FILE__, '.'), 1));
$mode_array = checkDiceModes($modes);
if(!$mode_array["valid"]){
return ($user->lang['INVALID_DICE_MODES']);
}
else
{
$dmode_string = $mode_array["string"];
$dmode_total = $mode_array["total"];
$dmode_quote = $mode_array["quote"];
}

if(!($dmode_string || $dmode_total))
{
$sql = 'SELECT forum_default_dice_mode FROM ' . FORUMS_TABLE . ' WHERE forum_id =' . $forum_id;
$result = $db->sql_query($sql);
$default_dmode = $db->sql_fetchfield('forum_default_dice_mode');
$dmode_string = (($default_dmode & 1)==1);
$dmode_total = (($default_dmode & 2)==2);
}
if(!($dmode_string || $dmode_total))
$dmode_string = true;

$dice_abbr = $dice_roll['numdice'] . $user->lang['DICE_CHAR'] . $dice_roll['numsides'];
if($dice_roll['math_string']!=""){
$dmode_total = true;
$dice_abbr = preg_replace('/x/' , $dice_abbr , $dice_roll['math_string']);
}

//get display mode
$carry_disp_opts = explode(":", $config['dice_themes']);
$carry_disp = $user->data['user_dice_disp'];
$dice_disp = (count($carry_disp_opts)>$carry_disp?$carry_disp_opts[$carry_disp]:$carry_disp_opts[0]);

//get the dice roll, create dice roll text for the roll itself
$offset = -1;
$roll = '';
global $phpbb_root_path;
if($dmode_string)
{
if($dice_disp == 'text'){
$roll = preg_replace('#([0-9]+)[:]?#', "<span title=\"\$1{$user->lang['ON_A_DIE']}{$dice_roll['numsides']}\">\$1</span>, ", $dice_roll['dice_roll']);
$roll = rtrim($roll, ", ");
}
else{
$roll = preg_replace('#([0-9]+)[:]?#', "<img src=\"{$phpbb_root_path}dicemod/skins/{$dice_disp}/d{$dice_roll['numsides']}_\$1.gif\" alt=\"\$1,\" title=\"\$1{$user->lang['ON_A_DIE']}{$dice_roll['numsides']}\" /> ", $dice_roll['dice_roll']);
$roll = rtrim($roll);
$pos = strrpos($roll, '," title="');
$roll = substr($roll, 0, $pos) . substr($roll, $pos+1);
}
$roll = '<b>'.$roll.'</b>';
}
else
{
$roll = preg_replace('#([0-9]+)[:]?#', "\$1, ", $dice_roll['dice_roll']);
$roll = rtrim($roll, ", ");
}
$haystack = ($user->lang['PATTERN_ROLL_STRING']) . ($dmode_total?$user->lang['PATTERN_ROLL_TOTAL']:'') . (!$dmode_string?'.':(':<br>'.$roll));
if(!$dmode_string)
$haystack = '<span title="' . $roll . '">' . $haystack . '</span>';

//get username of the roll's owner
$sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id=' . $dice_roll['user_id'];
$result = $db->sql_query($sql);
$dice_roller = $db->sql_fetchrow($result);

//create entire replacement text

if($dmode_quote OR $dice_roll['post_id']!=$row['post_id']){
$urllink = 'viewtopic.php?p='.$dice_roll['post_id'].'#p'.$dice_roll['post_id'];
$needles = array('>','<','[%u]','[%d]','[%t]','[%l]');
$replace = array('>','<',$dice_roller['username'],$dice_abbr,floatval($dice_roll['total']),$urllink);
//parse the dice roll with the dice values
$dice_roll['disproll'] = str_replace($needles , $replace , '<a href="[%l]">'. $user->lang['ROLLS_ORIGINAL_POST'] .':</a> ' . $haystack);
}
else{
$needles = array('[%u]','[%d]','[%t]');
$replace = array($dice_roller['username'],$dice_abbr,floatval($dice_roll['total']));
$dice_roll['disproll'] = str_replace($needles , $replace , $haystack);

//if this is the original post (checked above) and the user is a moderator, add a removability link
if($auth->acl_get('m_edit', $forum_id)){
$urllink = 'viewtopic.php?p='.$dice_roll['post_id'];
if($dice_roll['can_remove']){
$dice_roll['disproll'] .= ' <a href="' . $urllink . '&diceID=' . $dice_roll['id'] . '&removability=0">' . $user->lang['MAKE_UNREMOVABLE'] . '</a>';
}
else{
$dice_roll['disproll'] .= ' <a href="' . $urllink . '&diceID=' . $dice_roll['id'] . '&removability=1">' . $user->lang['MAKE_REMOVABLE'] . '</a>';
}
}
}
return '<div>' . $dice_roll['disproll'] . '</div>';
}
else
{
return $user->lang['INVALID_DICE_CODE'];
}
}
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="includes/constants.php">
<edit>
<comment lang="en">Add the BBCode ID constants for the new dice BBCodes.</comment>
<find><![CDATA[// Additional constants]]></find>
<action type="after-add"><![CDATA[/*
BEGIN DICEMOD
*/
define('DICE_BBCODE_ID', 1000);
define('DICE_ACTION_BBCODE_ID', 2000);
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Add the table name constant for the dice roll table.</comment>
<find><![CDATA[// Additional tables]]></find>
<action type="after-add"><![CDATA[/*
BEGIN DICEMOD
*/
define('DICE_TABLE', $table_prefix . 'dice');
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="includes/functions_admin.php">
<edit>
<comment lang="en">Make removing posts and topics via mod and admin tools remove the dice rolls, too</comment>
<find><![CDATA[ $table_ary = array(POSTS_TABLE, REPORTS_TABLE);]]></find>
<action type="replace-with"><![CDATA[ $table_ary = array(POSTS_TABLE, REPORTS_TABLE, DICE_TABLE);]]></action>
</edit>
</open>

<open src="includes/functions_posting.php">
<edit>
<comment lang="en">If a post is deleted, remove the dice rolls associated with it.</comment>
<find><![CDATA[ if ($data['post_reported'] && ($post_mode != 'delete_topic'))
{
sync('topic_reported', 'topic_id', array($topic_id));
}]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
//remove the dice code from the database
$sql = 'DELETE FROM ' . DICE_TABLE . ' WHERE post_id=' . $post_id;
$db->sql_query($sql);
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="includes/acp/acp_forums.php">
<edit>
<comment lang="en">Add variable to forum data array.</comment>
<find><![CDATA[ 'forum_style' => request_var('forum_style', 0),]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'forum_allow_dice' => request_var('forum_allow_dice', 0),
'forum_default_dice_mode' => request_var('forum_default_dice_mode', 1),
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Initialize variable for forumcreation.</comment>
<find><![CDATA[ 'forum_style' => 0,]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'forum_allow_dice' => 0,
'forum_default_dice_mode' => 1,
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Create replacement identifier for html code for permission option.</comment>
<find><![CDATA[ 'S_STYLES_OPTIONS' => $styles_list,]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'S_ALLOW_DICE' => $forum_data['forum_allow_dice'],
'S_DEFAULT_DICE_MODE' => $forum_data['forum_default_dice_mode'],
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="includes/ucp/ucp_prefs.php">
<edit>
<comment lang="en">Create variable for dice-skin dropdown menu.</comment>
<find><![CDATA[ 'post_st' => request_var('post_st', (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0),]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'dice_disp' => request_var('dice_disp', (!empty($user->data['user_dice_disp'])) ? $user->data['user_dice_disp'] : 0),
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Define variable for dice-skin dropdown menu.</comment>
<find><![CDATA[ 'user_post_show_days' => $data['post_st'],]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'user_dice_disp' => $data['dice_disp'],
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Create html code for dice-skin dropdown menu.</comment>
<find><![CDATA[ $template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',

'S_IMAGES' => $data['images'],]]></find>
<action type="before-add"><![CDATA[ /*
BEGIN DICEMOD
*/
$dice_themes = array();
$i = 0;
$s_dice_themes = '<select name="dice_disp">';
foreach(explode(":", $config['dice_themes']) as $dice_theme)
{
$selected = ($data['dice_disp'] == $i) ? ' selected="selected"' : '';
$s_dice_themes.= '<option value="' . $i . '"' . $selected . '>' . ($dice_theme == 'text' ? $user->lang['DICE_TEXT_MODE'] : ucfirst($dice_theme)) . '</option>';
$i++;
}
$s_dice_themes.= '</select>';
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Create replacement identifier for html code for dice-skin dropdown menu.</comment>
<find><![CDATA[ 'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors') && $config['allow_nocensors']) ? true : false,]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'S_DICE_DISP' => $s_dice_themes,
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="language/en/common.php">
<edit>
<comment lang="en">Add the text for the dice BBCode to the language array.</comment>
<find><![CDATA[?>]]></find>
<action type="before-add"><![CDATA[/*
BEGIN DICEMOD
*/
$lang = array_merge($lang, array(
'DICE_CHAR' => 'd', /*char used in the [dice]3d6[/dice], e.g.: DICE_CHAR = 'w' -> [dice]3w6[/dice]*/
'INVALID_DICE_CODE' => 'Invalid dice code!',
'INVALID_DICE_MODES' => 'Invalid dice modes or mode combination!',
'INVALID_DICE_ROLL' => 'Invalid dice roll!',
'MUST_HAVE_DICE_CODE' => 'You may not remove this dice code. If you wish to remove this dice code, please contact a moderator or an administrator.',
'MAKE_REMOVABLE' => '[Make removable]',
'MAKE_UNREMOVABLE' => '[Make unremovable]',
'NO_DOUBLE_DICE_CODE' => 'You may not post a dice roll more than once in it\'s original post without a quote tag.',
'ON_A_DIE' => ' on a d',
'PATTERN_ROLL_TOTAL' => ' and got a total of <b>[%t]</b>',
'PATTERN_ROLL_STRING' => '[%u] rolled [%d]',
'ROLLS_ORIGINAL_POST' => 'Original post',
));
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="language/en/posting.php">
<edit>
<comment lang="en">Add the text for the dice BBCode button helpline to the language array.</comment>
<find><![CDATA[ 'CURRENT_TOPIC' => 'Current topic',]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'CUSTOM_BBCODE_DICE_HELP' => '[dice]3d6[/dice] rolls 3 dice with 6 sides.',
/*
END DICEMOD
*/]]></action>
</edit>
</open>

<open src="language/en/ucp.php">
<edit>
<comment lang="en">Add the text for the UCP dice mode selection.</comment>
<find><![CDATA[ 'DEMOTE_SELECTED' => 'Demote selected',]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICE
*/
'DICE_DISP' => 'Display dice',
'DICE_TEXT_MODE' => 'Text',
/*
END DICE
*/]]></action>
</edit>
</open>

<open src="language/en/acp/forums.php">
<edit>
<comment lang="en">Add the text for the ACP forum radio buttons.</comment>
<find><![CDATA[ 'DELETE_SUBFORUMS' => 'Delete subforums and posts',]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICEMOD
*/
'DICE_ALWAYS' => 'Always',
'DICE_DEPENDS' => 'Depend on User',
'DICE_STRING' => 'String',
'DICE_TOTAL' => 'Total',
'DICE_STRING_TOTAL' => 'String and Total',
/*
END DICEMOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Add the text for the ACP forum permission.</comment>
<find><![CDATA[ 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 everything is forum based. A category is just a special type of forum. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. <strong>You need to copy or set appropriate permissions for newly created forums to have them displayed.</strong>',]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICE MOD
*/
'FORUM_ALLOW_DICE' => 'Allow Dice',
'FORUM_ALLOW_DICE_EXPLAIN' => 'If set to \'Always\' every user will be allowed to roll dice in this forum. If set to \'Depend on User\' only users with permission will be allowed to roll dice in this forum.',
'FORUM_DICE_DEFAULT_MODE' => 'Default Dice Mode',
'FORUM_DICE_DEFAULT_MODE_EXPLAIN' => 'Default displaymode for dicerolls, used when no user selection is made in the dice bbcode.',
/*
END DICE MOD
*/]]></action>
</edit>
</open>

<open src="language/en/acp/permissions_phpbb.php">
<edit>
<comment lang="en">Add the text for the ACP permission radio buttons.</comment>
<find><![CDATA[ 'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'misc'),]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICE MOD
*/
'acl_f_allow_dice' => array('lang' => 'Can roll dice', 'cat' => 'misc'),
/*
END DICE MOD
*/]]></action>
</edit>
<edit>
<comment lang="en">Add the text for the ACP permission radio buttons.</comment>
<find><![CDATA[ 'acl_m_ban' => array('lang' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', 'cat' => 'misc'), // This moderator setting is only global (and not local)]]></find>
<action type="after-add"><![CDATA[ /*
BEGIN DICE MOD
*/
'acl_m_craft_dice' => array('lang' => 'Can craft dice rolls', 'cat' => 'misc'),
/*
END DICE MOD
*/]]></action>
</edit>
</open>

<diy-instructions lang="en"><![CDATA[AFTER Uploading the new and updated files, there are 6 tasks that you need to perform manually:

ONE: Apply changes to the styles you want to use.
(1) If you only want to use the prosilver style, follow the instructions in styles/install_style_prosilver.xml
(2) Otherwise change the same template file mentioned in install_style_prosilver.xml in the styles you want to use in a manner similar to the instructions provided for the prosilver style.

TWO: Updating the database
(1) Open up an internet browser
(2) Navigate to the updateDatabase.php file in your base phpbb directory
(3) Let that file install the needed database updates
(4) Delete updateDatabase.php after it has finished

THREE: ACP BBCode addition for [dice]
(1) Go to Administration Control Panel
(2) Navigate to Posting -> BBCodes -> Add a new BBcode
(3) Under "BBCode usage", enter: [dice]{TEXT}[/dice]
(4) Under "HTML replacement", leaves it empty
(5) Under "Help line", enter: CUSTOM_BBCODE_DICE_HELP
(6) Under "Display on posting page", select the box to display the button for [dice]
(7) Click Submit to save your new BBcode
(8) Get your BBcode ID by:
(8.1) Click on the "Edit (green image)" button
(8.2) Remember the ID on the URL (i.e. &mode=bbcodes&action=edit&bbcode=XX, XX is the number)
(9) Find define('DICE_BBCODE_ID', 1000); in includes/constants.php
(10) Change 1000 to the bbcode ID XX from (8), e.g. define('DICE_BBCODE_ID', 18);

FOUR: ACP BBCode addition for [dice=]
(1) Go to Administration Control Panel
(2) Navigate to Posting -> BBCodes -> Add a new BBcode
(3) Under "BBCode usage", enter: [dice={TEXT1}]{TEXT2}[/dice]
(4) Under "HTML replacement", leaves it empty
(5) Under "Help line", leave it empty
(6) Under "Display on posting page", do not select the box to display the button for [dice=]
(7) Click Submit to save your new BBcode
(8) Get your BBcode ID by:
(8.1) Click on the "Edit (green image)" button
(8.2) Remember the ID on the URL (i.e. &mode=bbcodes&action=edit&bbcode=XX, XX is the number)
(9) Find define('DICE_ACTION_BBCODE_ID', 2000); in includes/constants.php
(10) Change 2000 to the bbcode ID XX from (8), e.g. define('DICE_ACTION_BBCODE_ID', 18)

FIVE: ACP Module setup
(1) Go to Administration Control Panel
(2) Navigate to System -> Module Management/Administration Control Panel
(3) Enable and enter ".MODS"
(4) Create a new Category named "Dicemod" and enable it
(5) Enter "Dicemod"
(6) Create a new Module named "DICEMOD_GENERAL", enable it, display it and choose Dicemod[acp_dicemod] from the module list. Leave the module mode as it is.
(7) Go to the ACP's General Tab and clear the cache.

SIX: Enable rolling dice
(1) Edit the fora you wish to enable rolling dice in via acp
(2) Toggle the permission level of your choice and submit
(3) Go to the permissions tab and enable the users/groups of your choice to roll dice in the selected fora - this is only needed for fora which are set to the "Depend on user" level
(4) Go roll some dice =)]]></diy-instructions>

</action-group>
</mod>[/code]
Avatar do usuário
robra
Membro Sênior
Membro Sênior
Mensagens: 6065
Registrado em: 02 Dez 2010, 22:29

Re: Instalação Dicemod 0.8.8b

Mensagem por robra »

Cara... é só ler o artigo Como instalar um MOD.
Tá lá explicado:
O install:

É um arquivo .XML que pode ter o nome de install.xml ou nomedomod.xml
Este arquivo deve ser aberto em qualquer navegador.
Significa Firefox, IE, etc.

Abraço. Imagem
[DICA] Antes de abrir um Novo Tópico, procure saber se a sua dúvida já foi respondida. Pesquise no Google por palavras(em inglês também) relacionadas à ela, somado à palavra "phpbb".
Trancado