Bon avant de me lancer je vais demander à l'auteur du mod car apparemment ça existe déja dedans sans modif
Modérateur: Modérateurs

##############################################################
## MOD Title: Allow BBcode in Photo Album MOD description
## MOD Author: cheesypeanut < simonpitfield@frogspawn.org > (Simon
Pitfield) http://www.frogspawn.org
## MOD Description: Allows BBcode in the description field
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: 6
## album_mod/clown_album_functions.php
## album_cat.php
## album_edit.php
## album_showpage.php
## album_upload.php
## templates/subSilver/album_showpage_body.tpl
## 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:
##
## REQUIREMENTS:
## -------------
## This MOD requires Smartor's Photo Album MOD and CLoWN's Supercharged
Album Pack 1
## to both be installed. This MOD also requires an alteration of the
database structure;
## the addition of the field `pic_bbcode_uid` in the `album` table.
##
##############################################################
## MOD History:
##
## 2005-02-22 - Version 1.0.0
## - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files
Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------------
#
ALTER TABLE `phpbb_album` ADD `pic_bbcode_uid` VARCHAR( 10 ) NOT NULL
AFTER `pic_desc` ;
#
#-----[ OPEN ]------------------------------------------------
#
album_mod/clown_album_functions.php
#
#-----[ FIND ]------------------------------------------------
#
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&', '<', '>');
$unhtml_specialchars_match = array('#>#', '#<#', '#"#',
'#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');
//
// This function will prepare a posted message for
// entry into the database.
//
function prepare_message($message, $html_on, $bbcode_on, $smile_on,
$bbcode_uid = 0)
{
global $board_config, $html_entities_match, $html_entities_replace;
//
// Clean up the message
//
$message = trim($message);
if ($html_on)
{
$allowed_html_tags = split(',', $board_config['allow_html_tags']);
$end_html = 0;
$start_html = 1;
$tmp_message = '';
$message = ' ' . $message . ' ';
while ($start_html = strpos($message, '<', $start_html))
{
$tmp_message .= preg_replace($html_entities_match,
$html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));
if ($end_html = strpos($message, '>', $start_html))
{
$length = $end_html - $start_html + 1;
$hold_string = substr($message, $start_html, $length);
if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)
{
$tmp_message .= preg_replace($html_entities_match,
$html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
$hold_string = substr($hold_string, $unclosed_open - 1);
}
$tagallowed = false;
for ($i = 0; $i < sizeof($allowed_html_tags); $i++)
{
$match_tag = trim($allowed_html_tags[$i]);
if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string))
{
$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[\t
]*?=|on[\w]+[\t ]*?=)#i', $hold_string)) ? false : true;
}
}
$tmp_message .= ($length && !$tagallowed) ?
preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;
$start_html += $length;
}
else
{
$tmp_message .= preg_replace($html_entities_match,
$html_entities_replace, substr($message, $start_html, strlen($message)));
$start_html = strlen($message);
$end_html = $start_html;
}
}
if (!$end_html || ($end_html != strlen($message) && $tmp_message !=
''))
{
$tmp_message .= preg_replace($html_entities_match,
$html_entities_replace, substr($message, $end_html + 1));
}
$message = ($tmp_message != '') ? trim($tmp_message) :
trim($message);
}
else
{
$message = preg_replace($html_entities_match, $html_entities_replace,
$message);
}
if($bbcode_on && $bbcode_uid != '')
{
$message = bbencode_first_pass($message, $bbcode_uid);
}
return $message;
}
#
#-----[ OPEN ]------------------------------------------------
#
album_cat.php
#
#-----[ FIND ]------------------------------------------------
#
$template->assign_block_vars('picrow.piccol', array(
'U_PIC' => ($album_config['fullpic_popup']) ?
append_sid("album_pic.$phpEx?pic_id=". $picrow[$j]['pic_id']) :
append_sid("album_showpage.$phpEx?pic_id=". $picrow[$j]['pic_id']),
'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=".
$picrow[$j]['pic_id']),
'DESC' => $picrow[$j]['pic_desc'],
'APPROVAL' => $approval_link,
)
);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$picrow[$j]['pic_desc'] =
preg_replace('/\[img:[a-z0-9]{10,}\].*?\[\/img:[a-z0-9]{10,}\]/', '', $picrow[$j]['pic_desc']);
$picrow[$j]['pic_desc'] = preg_replace('/\[\/?url(=.*?)?\]/', '',
$picrow[$j]['pic_desc']);
$picrow[$j]['pic_desc'] =
preg_replace('/\[\/?[a-z\*=\+\-]+(\:?[0-9a-z]+)?:[a-z0-9]{10,}(\:[a-z0-9]+)?=?.*?\]/', '',
$picrow[$j]['pic_desc']);
#
#-----[ OPEN ]------------------------------------------------
#
album_edit.php
#
#-----[ FIND ]------------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
#
#-----[ FIND ]------------------------------------------------
#
$template->set_filenames(array(
'body' => 'album_edit_body.tpl')
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( $thispic['pic_bbcode_uid'] != '' )
{
$thispic['pic_desc'] = preg_replace('/\:(([a-z0-9]:)?)' .
$thispic['pic_bbcode_uid'] . '/s', '', $thispic['pic_desc']);
}
#
#-----[ FIND ]------------------------------------------------
#
$pic_title = str_replace("\'", "''",
htmlspecialchars(trim($HTTP_POST_VARS['pic_title'])));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$html_on = ( $userdata['user_allowhtml'] &&
$board_config['allow_html'] ) ? 1 : 0 ;
$bbcode_on = ( $userdata['user_allowbbcode'] &&
$board_config['allow_bbcode'] ) ? 1 : 0 ;
$smilies_on = ( $userdata['user_allowsmile'] &&
$board_config['allow_smilies'] ) ? 1 : 0 ;
#
#-----[ FIND ]------------------------------------------------
#
$pic_desc = str_replace("\'", "''",
htmlspecialchars(substr(trim($HTTP_POST_VARS['pic_desc']), 0, $album_config['desc_length'])));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : '';
$pic_desc = prepare_message($pic_desc, $html_on, $bbcode_on,
$smilies_on, $bbcode_uid);
#
#-----[ FIND ]------------------------------------------------
#
SET pic_title = '$pic_title', pic_desc= '$pic_desc'
#
#-----[ INLINE, FIND ]------------------------------------------
#
, pic_desc= '$pic_desc'
#
#-----[ AFTER, ADD ]------------------------------------------------
#
, pic_bbcode_uid = '$bbcode_uid'
#
#-----[ OPEN ]------------------------------------------------
#
album_showpage.php
#
#-----[ FIND ]------------------------------------------------
#
if( empty($thispic) )
{
message_die(GENERAL_ERROR, $lang['Pic_not_exist'] . ' -> ' . $pic_id);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( $thispic['pic_bbcode_uid'] != '' )
{
$thispic['pic_desc'] = ( $board_config['allow_bbcode'] ) ?
bbencode_second_pass($thispic['pic_desc'], $thispic['pic_bbcode_uid']) :
preg_replace('/\:[0-9a-z\:]+\]/si', ']', $thispic['pic_desc']);
}
#
#-----[ OPEN ]------------------------------------------------
#
#
album_upload.php
#
#-----[ FIND ]------------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
#
#-----[ FIND ]------------------------------------------------
#
$pic_title = str_replace("\'", "''",
htmlspecialchars(trim($HTTP_POST_VARS['pic_title'])));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$html_on = ( $userdata['user_allowhtml'] &&
$board_config['allow_html'] ) ? 1 : 0 ;
$bbcode_on = ( $userdata['user_allowbbcode'] &&
$board_config['allow_bbcode'] ) ? 1 : 0 ;
$smilies_on = ( $userdata['user_allowsmile'] &&
$board_config['allow_smilies'] ) ? 1 : 0 ;
#
#-----[ FIND ]------------------------------------------------
#
$pic_desc = str_replace("\'", "''",
htmlspecialchars(substr(trim($HTTP_POST_VARS['pic_desc']), 0, $album_config['desc_length'])));
#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : '';
$pic_desc = prepare_message($pic_desc, $html_on, $bbcode_on,
$smilies_on, $bbcode_uid);
#
#-----[ FIND ]------------------------------------------------
#
$sql = "INSERT INTO ". ALBUM_TABLE ." (pic_filename, pic_thumbnail,
pic_title, pic_desc, pic_user_id, pic_user_ip, pic_username, pic_time,
pic_cat_id, pic_approval)
#
#-----[ INLINE, FIND ]------------------------------------------
#
, pic_desc
#
#-----[ AFTER, ADD ]------------------------------------------------
#
, pic_bbcode_uid
#
#-----[ FIND ]------------------------------------------------
#
VALUES ('$pic_filename', '$pic_thumbnail', '$pic_title',
'$pic_desc', '$pic_user_id', '$pic_user_ip', '$pic_username', '$pic_time',
'$cat_id', '$pic_approval')";
#
#-----[ INLINE, FIND ]------------------------------------------
#
, '$pic_desc'
#
#-----[ AFTER, ADD ]------------------------------------------------
#
, '$bbcode_uid'
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/album_showpage_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<td valign="top"><b><span class="genmed">{PIC_DESC}</span></b></td>
#
#-----[ REPLACE WITH ]-----------------------------------------
#
<td valign="top"><span class="genmed">{PIC_DESC}</span></td>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM 
Personne a écrit:Bonsoir à tous
Y'a t-il un moyen de rajouter deux champs dans la fenêtre de l'album ?
Je souhaiterai rajouter :
- 1 champs auteur : le posteur n'est pas forcément l'auteur des photos
(étonnant que l'auteur du mod ne l'est pas prévu)
- 1 champs topic : je souhaiterai pouvoir rattacher la photo au post initial
Je sais j'abuse certainement![]()
j'ai demandé sur les site qui propose ce mod mais visiblement cela n'intéresse personne donc que moi
![]()
Merci d'avance



<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<!-- BEGIN recent_pics -->
<tr>
<td class="row1" width="{S_COL_WIDTH}" align="center"><a href="{recent_pics.recent_detail.U_PIC}"{TARGET_BLANK}><img src="{recent_pics.recent_detail.THUMBNAIL}" border="0" alt="{recent_pics.recent_detail.DESC}" title="{recent_pics.recent_detail.DESC}" vspace="10" /></a></td>
</tr>
<!-- END recent_pics -->
</table>
<br /><table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
<td align="left" width="15%" valign="bottom"><span class="gensmall">
<script src="http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj = new Object;obj.clockfile = "0012-silver.swf";obj.TimeZone = "CET";obj.width = 100;obj.height = 100;obj.wmode = "transparent";showClock(obj);</script>
</span></td>
<td align="left" width="35%" valign="bottom"><span class="gensmall">
<img src="http://personnellement.net/forum/templates/AcidTech/images/noel/perenoel1.gif" border="0" alt="" align="middle" ></img></a><img src="http://personnellement.net/forum/templates/AcidTech/images/noel/candy2.gif" border="0" alt="" align="middle" ></img></a><br />
<script language="JavaScript" type="text/javascript" src="http://www.personnellement.net/forum/topics_anywhere.php?mode=show&f=a&n=3&r=y&b=dis&lpb=0&lpd=3&lpi=y&af=p2xibKcgp3R0pyCncmVwpyBy6XAgp2ZupyAtIKdscGGnLCCnbHB0pyCnbHBppw%3D%3D">
</script></span></td>
[b]<td align="right" width="{S_COL_WIDTH}">
<!-- BEGIN recent_pics -->
<!-- BEGIN recent_col -->
<td width="{S_COL_WIDTH}" align="center" valign="bottom"><a href="{recent_pics.recent_col.U_PIC}"{TARGET_BLANK}><img src="{recent_pics.recent_col.THUMBNAIL}" border="0" alt="{recent_pics.recent_col.DESC}" title="{recent_pics.recent_col.DESC}" vspace="1" /><br/><br/></td>
<!-- END recent_col -->
<!-- END recent_pics -->
</td>[/b]
</table>
<br />
Retourner vers Le Forum phpBB2
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 34 invités