PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : PHPBB-Mod – HTML-Code entfernen


msilver
2010-03-13, 13:14:53
hi
ich fummel hier schon rum, aber jedes mal zerlege ich mir mein forum rein von der optik her.

ich habe ne videomod eingebaut, diese zeigt videos direkt im forum an, userwunsch, aber oben drüber steht immer etwas "Gehe zu Youtube Download Video phpBB Plugin". das möchten wir entfernen.

kann mir jemand helfen? wird denke nur eine zeile sein, aber die ich gedacht hatte waren es nicht.

hier der modtext und die embvid.php als code.

habe diese mod im forum:
## 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/
##############################################################
## Author Notes:
##
## Video URLs in signatures won't be replaced.
## Easily post the video url f.e.
## "http://www.youtube.com/watch?v=imehw6sj"
## without any bbcode-tags and this url will be
## automatically replaced.
## To avoid replacing the video URL use the [url] bbcode tag.
##
##############################################################
## MOD History:
##
## Version 1.0.1:
## - privmsg bug fix
## - myvideo bug fix
##
## Version 1.0.0:
## - Mod released
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]----------------------------------------------------------
#
copy includes/embvid.php to includes/embvid.php
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
define("BBCODE_UID_LEN", 10);
#
#-----[ AFTER, ADD ]------------------------------------------
#

//-- mod : embvid --------------------------------------------------------------
//-- add
include('embvid.php');
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$ret = ' ' . $text;
#
#-----[ AFTER, ADD ]------------------------------------------
#

//-- mod : embvid --------------------------------------------------------------
//-- add
$ret = embvid($ret);
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$user_sig = make_clickable($user_sig);
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- mod : embvid --------------------------------------------------------------
//-- add
$is_sig = true;
//-- fin mod : embvid ----------------------------------------------------------
$user_sig = make_clickable($user_sig);
//-- mod : embvid --------------------------------------------------------------
//-- add
$is_sig = false;
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
privmsg.php
#
#-----[ FIND ]------------------------------------------
#
$private_message .= '<br /><br />_________________<br />' . make_clickable($user_sig);
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- mod : embvid --------------------------------------------------------------
//-- add
$is_sig = true;
//-- fin mod : embvid ----------------------------------------------------------
$private_message .= '<br /><br />_________________<br />' . make_clickable($user_sig);
//-- mod : embvid --------------------------------------------------------------
//-- add
$is_sig = false;
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$preview_message = $preview_message . '<br /><br />_________________<br />' . $user_sig;
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- mod : embvid --------------------------------------------------------------
//-- delete
/*
$preview_message = $preview_message . '<br /><br />_________________<br />' . $user_sig;
*/
//-- add
$is_sig = true;
$user_sig = '<br /><br />_________________<br />' . $user_sig;
if ( count($orig_word) )
{
$user_sig = preg_replace($orig_word, $replacement_word, $user_sig);
}
if ( $smilies_on )
{
$user_sig = smilies_pass($user_sig);
}
$is_sig = false;
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$preview_message = make_clickable($preview_message);
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- mod : embvid --------------------------------------------------------------
//-- delete
/*
$preview_message = make_clickable($preview_message);
*/
//-- add
$preview_message = make_clickable($preview_message) . $user_sig;
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$user_sig = make_clickable($user_sig);
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- mod : embvid --------------------------------------------------------------
//-- add
$is_sig = true;
//-- fin mod : embvid ----------------------------------------------------------
$user_sig = make_clickable($user_sig);
//-- mod : embvid --------------------------------------------------------------
//-- add
$is_sig = false;
//-- fin mod : embvid ----------------------------------------------------------
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

<?php
/*
© www.marc-gutt.de 2008
Marc Gutt Services
embvid for phpbb2
Version: 1.0.1
*/

if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}

function embvid($message)
{
global $lang, $userdata, $is_sig;
// signature switch
if ( isset($is_sig) && $is_sig )
{
return $message;
}
// settings
// prefer 4:3 ratio
$width = 400;
$height = 300;
$download = true;
$videos_per_post = 5;
// download sites
$sites = array(
'lang_english' => 'http://www.savids.com/#',
'lang_german' => 'http://www.2video.de/#',
);
// player
$begin = '\\1<table border="0" cellpadding="0" cellspacing="2"><tr><td align="left"><span class="gensmall"><a href="\\2" target="_blank">' . $lang['Jump_to'] . ' ';
$middle = '</a> ' . ($download ? '<a href="' . (isset($sites[ $userdata['user_lang'] ]) ? $sites[ $userdata['user_lang'] ] : current($sites)) . '\\2" title="Download Video" target="_blank">Download Video</a>' : '') . '</span></td><td align="right"><span class="gensmall"><a href="http://www.phpbb-de.com" target="_blank" title="phpBB">phpBB</a> Plugin</span></td></tr><tr><td colspan="2">';
$players = array(
'<div id="embed\\3"><script type="text/javascript" src="http://www.bendecho.de/embed/video?videoid=\\3"></script></div>',
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' . $width . '" height="' . $height . '" id="player" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.clipfish.de/videoplayer.swf?as=0&videoid=\\3&r=1" /><param name="quality" value="high" /><param name="wmode" value="transparent"><param name="allowFullScreen" value="true" /><embed src="http://www.clipfish.de/videoplayer.swf?as=0&videoid=\\3&r=1" quality="high" width="' . $width . '" height="' . $height . '" name="player" align="middle" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>',
'<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.dailymotion.com/swf/\\3"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/\\3" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" allowFullScreen="true" allowScriptAccess="always" wmode="transparent"></embed></object>',
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="' . $width . '" height="' . $height . '"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid=\\3"/> <param name="wmode" value="transparent"> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid=\\3" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed> </object>',
'<embed style="width:' . $width . 'px; height:' . $height . 'px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=\\3" flashvars="" wmode="transparent"> </embed>',
'<embed src="http://www.metacafe.com/fplayer/\\3/\\4.swf" width="' . $width . '" height="' . $height . '" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed>',
'<embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m=\\3&v=2&type=video" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed>',
'<object style="width:' . $width . 'px;height:' . $height . 'px;" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" data="http://www.myvideo.\\3/movie/\\4"> <param name="movie" value="http://www.myvideo.\\3/movie/\\4"/> <param name="AllowFullscreen" value="true" /><param name="wmode" value="transparent"></param> </object>',
'<object width="' . $width . '" height="' . $height . '"><param name="FlashVars" value="apiHost=api.sevenload.com"/><param name="AllowScriptAccess" value="always"/><param name="wmode" value="transparent"></param><param name="movie" value="\\3/pl/\\4/425x350/swf" /><embed src="\\3/pl/\\4/425x350/swf" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" allowfullscreen="true" AllowScriptAccess="always" FlashVars="apiHost=api.sevenload.com" wmode="transparent"></embed></object>',
'<embed src="http://videos.streetfire.net/vidiac.swf" FlashVars="video=\\3" quality="high" wmode="transparent" width="' . $width . '" height="' . $height . '" name="ePlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>',
// '<object width="' . $width . '" height="' . $height . '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param name="movie" value="http://www.videotube.de/flash/player.swf"></param> <param name="flashvars" value="baseURL=http%3A%2F%2Fwww.videotube.de%2Fwatch%2F\\3"></param> <param name="quality" value="best"> <param name="wmode" value="transparent"> <param name="allowScriptAccess" value="always"> <param name="swLiveConnect" value="true"> <embed src="http://www.videotube.de/flash/player.swf" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" flashvars="baseURL=http%3A%2F%2Fwww.videotube.de%2Fwatch%2F\\3" quality="best" wmode="transparent" allowscriptaccess="always" swliveconnect="true"></embed> </object>',
'<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.youtube.com/v/\\3"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/\\3" type="application/x-shockwave-flash" wmode="transparent" width="' . $width . '" height="' . $height . '"></embed></object>',
);
$end = '</td></tr></table>' . "\n";
// build search
$search = array(
'Bendecho' => '#(^|[\n ])(http://[\w\.]*?bendecho\.de/([\w]+)-[\w\-]+)(^[\t <\n\r\]\[])*#is',
'Clipfish' => '#(^|[\n ])(http://[\w\.]*?clipfish\.de/player\.php\?videoid=([\w%]+)(&[\w=+&;]*)*)(^[\t <\n\r\]\[])*#is',
'Dailymotion' => '#(^|[\n ])(http://[\w\.]*?dailymotion\.com.*?/video/([\w]+)_[\w\-]+)(^[\t <\n\r\]\[])*#is',
'Gametrailers' => '#(^|[\n ])(http://[\w\.]*?gametrailers\.com/player/([\w]+?)\.html)(^[\t <\n\r\]\[])*#is',
'Google Video' => '#(^|[\n ])(http://video\.google\.[\w\.]+?/videoplay\?docid=([\w\-]+)(&[\w=+&;-]*)*)(^[\t <\n\r\]\[])*#is',
'Metacafe' => '#(^|[\n ])(http://[\w\.]*?metacafe\.com/watch/([\w]+?)/([\w\-]+?)/)(^[\t <\n\r\]\[])*#is',
'MySpace' => '#(^|[\n ])(http://[\w\.]*?myspace\.com/index\.cfm\?fuseaction=vids.individual&videoid=([\w]+))(^[\t <\n\r\]\[])*#is',
'MyVideo' => '#(^|[\n ])(http://[\w\.]*?myvideo\.([\w]+?)/watch/([\w]+))(^[\t <\n\r\]\[])*#is',
'Sevenload' => '#(^|[\n ])((http://[\w\.]*?sevenload.com)/videos/([\w]+?)/[\w\-]+)(^[\t <\n\r\]\[])*#is',
'Streetfire' => '#(^|[\n ])(http://videos\.streetfire\.net/.*?/([\w\-]+?)\.htm)(^[\t <\n\r\]\[])*#is',
// 'Videotube' => '#(^|[\n ])(http://[\w\.]*?videotube\.de/watch/([\w]+))(^[\t <\n\r\]\[])*#is',
'Youtube' => '#(^|[\n ])(http://[\w\.]*?youtube\.[\w\.]+?/watch\?v=([\w\-]+)(&[\w=+&;%]*)*)(^[\t <\n\r\]\[])*#is',
);
// build replace
$replace = array();
current($search);
$portal = key($search);
foreach ( $players as $embvid )
{
$replace[] = $begin . $portal . $middle . $embvid . $end;
next($search);
$portal = key($search);
}
// search & replace
return preg_replace($search, $replace, $message, $videos_per_post);
}

?>

RattuS
2010-03-13, 14:38:28
In $begin, $middle und $players einfach den Text bzw. die Links entsprechend modifizieren. Solange du von den Table-Tags nichts entfernst, zerstörst du das Layout auch nicht.


// player
$begin = '\\1<table border="0" cellpadding="0" cellspacing="2"><tr><td align="left"><span class="gensmall"><a href="\\2" target="_blank">' . $lang['Jump_to'] . ' ';
$middle = '</a> ' . ($download ? '<a href="' . (isset($sites[ $userdata['user_lang'] ]) ? $sites[ $userdata['user_lang'] ] : current($sites)) . '\\2" title="Download Video" target="_blank">Download Video</a>' : '') . '</span></td><td align="right"><span class="gensmall"><a href="http://www.phpbb-de.com" target="_blank" title="phpBB">phpBB</a> Plugin</span></td></tr><tr><td colspan="2">';
$players = array(
'<div id="embed\\3"><script type="text/javascript" src="http://www.bendecho.de/embed/video?videoid=\\3"></script></div>',
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' . $width . '" height="' . $height . '" id="player" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.clipfish.de/videoplayer.swf?as=0&videoid=\\3&r=1" /><param name="quality" value="high" /><param name="wmode" value="transparent"><param name="allowFullScreen" value="true" /><embed src="http://www.clipfish.de/videoplayer.swf?as=0&videoid=\\3&r=1" quality="high" width="' . $width . '" height="' . $height . '" name="player" align="middle" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>',
'<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.dailymotion.com/swf/\\3"></param><param name="allowFullScreen" value="true"></param><param name="wmode" value="transparent"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/\\3" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" allowFullScreen="true" allowScriptAccess="always" wmode="transparent"></embed></object>',
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="' . $width . '" height="' . $height . '"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid=\\3"/> <param name="wmode" value="transparent"> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid=\\3" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed> </object>',
'<embed style="width:' . $width . 'px; height:' . $height . 'px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=\\3" flashvars="" wmode="transparent"> </embed>',
'<embed src="http://www.metacafe.com/fplayer/\\3/\\4.swf" width="' . $width . '" height="' . $height . '" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed>',
'<embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m=\\3&v=2&type=video" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" wmode="transparent"></embed>',
'<object style="width:' . $width . 'px;height:' . $height . 'px;" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" data="http://www.myvideo.\\3/movie/\\4"> <param name="movie" value="http://www.myvideo.\\3/movie/\\4"/> <param name="AllowFullscreen" value="true" /><param name="wmode" value="transparent"></param> </object>',
'<object width="' . $width . '" height="' . $height . '"><param name="FlashVars" value="apiHost=api.sevenload.com"/><param name="AllowScriptAccess" value="always"/><param name="wmode" value="transparent"></param><param name="movie" value="\\3/pl/\\4/425x350/swf" /><embed src="\\3/pl/\\4/425x350/swf" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" allowfullscreen="true" AllowScriptAccess="always" FlashVars="apiHost=api.sevenload.com" wmode="transparent"></embed></object>',
'<embed src="http://videos.streetfire.net/vidiac.swf" FlashVars="video=\\3" quality="high" wmode="transparent" width="' . $width . '" height="' . $height . '" name="ePlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>',
// '<object width="' . $width . '" height="' . $height . '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param name="movie" value="http://www.videotube.de/flash/player.swf"></param> <param name="flashvars" value="baseURL=http%3A%2F%2Fwww.videotube.de%2Fwatch%2F\\3"></param> <param name="quality" value="best"> <param name="wmode" value="transparent"> <param name="allowScriptAccess" value="always"> <param name="swLiveConnect" value="true"> <embed src="http://www.videotube.de/flash/player.swf" type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" flashvars="baseURL=http%3A%2F%2Fwww.videotube.de%2Fwatch%2F\\3" quality="best" wmode="transparent" allowscriptaccess="always" swliveconnect="true"></embed> </object>',
'<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.youtube.com/v/\\3"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/\\3" type="application/x-shockwave-flash" wmode="transparent" width="' . $width . '" height="' . $height . '"></embed></object>',
);
$end = '</td></tr></table>' . "\n";

msilver
2010-03-13, 17:56:45
ja, da habe ich wohl zu viel entfernt.

was habe ich geändert?:
das
$middle = '</a> ' . ($download ? '<a href="' . (isset($sites[ $userdata['user_lang'] ]) ? $sites[ $userdata['user_lang'] ] : current($sites)) . '\\2" title="" target="_blank"></a>' : '') . '</span></td><td align="right"><span class="gensmall"><a href="" target="_blank" title="phpBB"></a> Plugin</span></td></tr><tr><td colspan="2">';

so war es vorher
$middle = '</a> ' . ($download ? '<a href="' . (isset($sites[ $userdata['user_lang'] ]) ? $sites[ $userdata['user_lang'] ] : current($sites)) . '\\2" title="Download Video" target="_blank">Download Video</a>' : '') . '</span></td><td align="right"><span class="gensmall"><a href="http://www.phpbb-de.com" target="_blank" title="phpBB">phpBB</a> Plugin</span></td></tr><tr><td colspan="2">';

das kommt leider


Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v125204/eliteboard/includes/embvid.php:1) in /www/htdocs/v125204/eliteboard/includes/page_header.php on line 487

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v125204/eliteboard/includes/embvid.php:1) in /www/htdocs/v125204/eliteboard/includes/page_header.php on line 489

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v125204/eliteboard/includes/embvid.php:1) in /www/htdocs/v125204/eliteboard/includes/page_header.php on line 490

msilver
2010-03-16, 06:33:03
würde mich über hilfe freuen :).

Blade II
2010-04-06, 16:43:05
Falls es noch aktuell ist:

Ersetz mal die $middle-Variable mit folgendem Code:
$middle = '</a></span></td><td align="right"><span class="gensmall"><a href="http://www.phpbb-de.com" target="_blank" title="phpBB">phpBB</a> Plugin</span></td></tr><tr><td colspan="2">';

oder falls auch der Text "phpBB Plugin" nicht erscheinen soll:
$middle = '</a></span></td><td align="right"></td></tr><tr><td colspan="2">';

msilver
2010-04-06, 19:39:46
hat leider auch nicht geklappt. ich lass es nun so!