In my seditio install I had some core hacks (at least, i think they were)
Can I apply these in cotonti to?
Here's a list of hacks I had:
- Gametrailer:
system/function.php find youtube code
affer add
Code:
'\\[games\\]([^\\([]*)\\[/games\\]' => '
<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="480" height="392"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid=\\1"/> <param name="quality" value="high" /> <embed src="http://www.gametrailers.com/remote_wrap.php?mid=\\1" 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="480" height="392"></embed> </object>',
plugins/texboxer2/inc/texboxer2.inc.php find
Code:
$res['youtube'] = array('[youtube]', '[/youtube]', 50);
add
Code:
$res['games'] = array('[games]', '[/games]', 51);
find
Code:
'youtube',
add
Code:
'games',
System/lang/main.lang.php find
Code:
$L['bbcodes_preview'] = "preview";
add
Code:
$L['bbcodes_games'] = "Gametrailer";
- modbreak
Go to functions.php and look up this line ;
Code:
'
' => '<blockquote><img src="/system/img/bbcodes/quote.gif"><hr />',
' ' => '<hr /></blockquote>',
Place infront of that ;
Code:
'[modbreak]' => '<div class="modbreak" align="center">MODBREAK</div><div class="modbreaker" align="center">',
'[/modbreak]' => '</div>',
Save functions.php
Go to your skin.css and add ;
Code:
.modbreak
{
background: #EFF0C2 url(fullpath to your image needed including
http://) no-repeat right;
border: 1px solid #ff9900;
border-bottom: 0px dotted #ff9900;
color: #000000;
font-family: Verdana;
font-size: 10px;
letter-spacing: 2px;
font-weight: bold;
margin: 0 auto 0 auto;
padding: 4px;
width: 98%;
}
.modbreaker
{
background: transparant;
border: 1px solid #ff9900;
color: #000000;
font-family: Verdana;
font-size: 10px;
margin: 0 auto 0 auto;
padding: 4px;
width: 98%;
}
Save and upload both files to your server !
- note hack
Go to your functions.php => Search for the line ;
Code:
'
' => '<blockquote><img src="/system/img/bbcodes/quote.gif"><hr />',
' ' => '<hr /></blockquote>',
Add before this line ;
Code:
'[note]' => '<div class="note">'.$L['Notes'].'</div><div class="noteblock">',
'[/note]' => '</div>',
NOTE ; .$L['Notes']. is already in your language file....
Save file !
Go to your skin .css => Add these following lines ;
Code:
.note
{
background: #EFF0C2 url(full path to your image) no-repeat left;
border: 1px solid #999999;
border-bottom: 0px solid #333333;
color: #000000;
font-size: 14px;
font-weight: bold;
margin: 0 auto 0 auto;
padding: 3px;
width: 48%;
}
.noteblock
{
background: #DBE5E9;
border: 1px solid #999999;
color: #000000;
font-family: Arial, sans-serif;
font-size: 12px;
margin: 0 auto 0 auto;
padding: 3px;
width: 48%;
}
Justify hack
This code has been asked on neocrome.net;
Go to functions.php look up this line ;
Code:
'
' => '<blockquote><img src="/system/img/bbcodes/quote.gif"><hr />',
' ' => '<hr /></blockquote>',
Add the following line above it ;
Code:
'
' => '<p style="text-align: justify; padding: 10px; border: 1px solid #999999;">',
'
' => '</p>',
Save your functions file and upload to your server !
Require registration for download
Description
OPEN: www/system/core/page/page.inc.php
FIND
CODE:
if($pag['page_file'])
{
if (!empty($pag['page_url']))
{
$dotpos = strrpos($pag['page_url'],".")+1;
$pag['page_fileicon'] = "system/img/pfs/".strtolower(substr($pag['page_url'], $dotpos, 5)).".gif";
if (!file_exists($pag['page_fileicon']))
{ $pag['page_fileicon'] = "system/img/admin/page.gif"; }
$pag['page_fileicon'] = "<img src=\"".$pag['page_fileicon']."\" alt=\"\">";
}
else
{ $pag['page_fileicon'] = ''; }
$t->assign(array(
"PAGE_FILE_URL" => "page.php?id=".$pag['page_id']."&a=dl",
"PAGE_FILE_SIZE" => $pag['page_size'],
"PAGE_FILE_COUNT" => $pag['page_filecount'],
"PAGE_FILE_ICON" => $pag['page_fileicon'],
"PAGE_FILE_NAME" => basename($pag['page_url'])
));
$t->parse("MAIN.PAGE_FILE");
}
REPLACE WITH
CODE:
if($pag['page_file'])
{
if($usr['id'] > 0)
{
if (!empty($pag['page_url']))
{
$dotpos = strrpos($pag['page_url'],".")+1;
$pag['page_fileicon'] = "system/img/pfs/".strtolower(substr($pag['page_url'], $dotpos, 5)).".gif";
if (!file_exists($pag['page_fileicon']))
{ $pag['page_fileicon'] = "system/img/admin/page.gif"; }
$pag['page_fileicon'] = "<img src=\"".$pag['page_fileicon']."\" alt=\"\">";
}
else
{
$pag['page_fileicon'] = '';
}
$t->assign(array(
"PAGE_FILE_URL" => "page.php?id=".$pag['page_id']."&a=dl",
"PAGE_FILE_SIZE" => $pag['page_size'],
"PAGE_FILE_COUNT" => $pag['page_filecount'],
"PAGE_FILE_ICON" => $pag['page_fileicon'],
"PAGE_FILE_NAME" => basename($pag['page_url'])
));
$t->parse("MAIN.PAGE_FILE");
}else{
$t->parse("MAIN.PAGE_FILE_ERROR");
}
}
FIND
CODE:
if($pag['page_file'] && $a=='dl')
{
$file_size = @filesize($row['page_url']);
$pag['page_filecount']++;
$sql = sed_sql_query("UPDATE $db_pages SET page_filecount=page_filecount+1 WHERE page_id='".$pag['page_id']."'");
header("Location: ".$pag['page_url']);
echo("<script type='text/javascript'>location.href='".$pag['page_url']."';</script>Redirecting...");
exit;
}
REPLACE WITH
CODE:
if($pag['page_file'] && $a=='dl')
{
if($usr['id'] > 0){
$file_size = @filesize($row['page_url']);
$pag['page_filecount']++;
$sql = sed_sql_query("UPDATE $db_pages SET page_filecount=page_filecount+1 WHERE page_id='".$pag['page_id']."'");
header("Location: ".$pag['page_url']);
echo("<script type='text/javascript'>location.href='".$pag['page_url']."';</script>Redirecting...");
exit;
}
else
{
header("Location: message.php?msg=930");
exit;
}
}
OPEN: www/skins/YOURSKIN/page.tpl
FIND
CODE:
<!-- BEGIN: PAGE_FILE -->
BEFORE ADD
CODE:
<!-- BEGIN: PAGE_FILE_ERROR -->
<div class="error">You must be registered to download files. Please <a href="users.php?m=auth" title="Register">Login</a>, or <a href="users.php?m=register" title="Register">Register</a>.</div>
<!-- END: PAGE_FILE_ERROR -->
- youtube hack
1. step: put this in functions.php
Code:
'\\[youtube\\]([^\\([]*)\\[/youtube\\]' => '<object width="400" height="329"><param name="movie" value="http://www.youtube.com/v/\\1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" wmode="transparent" width="400" height="329"></embed></object>',
so you can get the video putting [youtube]TaIyUVAW2rA[/youtube] from
http://www.youtube.com/watch?v=TaIyUVAW2rA
2 step: go to /plugins/textboxer2/inc/textboxer2.inc.php
and add below;
Code:
$tb2Buttons = array( option 6 ;
'youtube',
Stay in this document and lookup;
Code:
/* settings for buttons */
function tb2_getSettings(){
global $L;
after this add;
$res['youtube'] = array('[youtube]', '[/youtube]', 50); ( notice 30 is the iconnumber change it in the way you like. )
Copy bbcodes.gif to /plugins/textboxer2/themes
Have fun with this function. thx to rayblo
I know some of these are probably a standard in cotonti. like the youtube thingy and the download thingy, But i really need the gametrailer thing for my webby..[/][/]