Newbie
#1
Well Okey. My Plugin is giving nasty warnings =P hehe. Okey. Here's the code.

PHP Code:
<?php
/**
 * Copyright © 2005 CraKteR, crakter [at] gmail [dot] com
 */

function serverstats_info()
{
    return array(
        
"name"        => "Server Stats",
        
"description"    => "A little plugin",
        
"website"    => "http://nordicfilegalaxee.com/mcdc/forum/",
        
"author"    => "CraKteR",
        
"authorsite"    => "http://nordicfilegalaxee.com/mcdc/forum/",
        
"version"    => "1.0",
        );
}

function 
serverstats_activate()
{
    global 
$db;
    
// Insert all Varibles needed for Server Stats
    
require "./inc/adminfunctions_templates.php";
    
find_replace_templatesets("stats"'\#$footer'"\$server_stats\n\$footer");

    
// Insert all Templates needed for Server Stats
    
$templatearray = array(
        
"tid" => "NULL",
        
"title" => "server_stats",
        
"template" => "<table border=\"0\" cellspacing=\"\$theme[borderwidth]\" cellpadding=\"\$theme[tablespace]\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>Server Stats</strong></td>
</tr>
<tr>
<td class=\"trow1\" valign=\"top\">Server Uptime: \$uptime</td>
</tr>
</table>
<br />"
,
        
"sid" => "-1",
        );
        
$db->insert_query(TABLE_PREFIX."templates"$templatearray);
}

function 
serverstats_deactivate()
{
    global 
$db;
    
// Delete all Varibles needed in Server Stats
    
require "./inc/adminfunctions_templates.php";
    
find_replace_templatesets("stats"'#\$server_stats\n# '""0);

    
// Delete all Templates needed in Server Stats
    
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='server_stats'");
}
?>
It gives out these warnings ->
Code:
Warning: Delimiter must not be alphanumeric or backslash in /home/nordic/domains/nordicfilegalaxee.com/public_html/mcdc/forum/inc/adminfunctions_templates.php on line 25

Warning: Delimiter must not be alphanumeric or backslash in /home/nordic/domains/nordicfilegalaxee.com/public_html/mcdc/forum/inc/adminfunctions_templates.php on line 37

Well as I said I'm a newbie. Can someone help?
Reply
#2
thats becasue

find_replace_templatesets("stats", '\#$footer', "\$server_stats\n\$footer");

should be

find_replace_templatesets("stats", '#\$footer', "\$server_stats\n\$footer");
Reply
#3
I'm using this now (Because off another warning)

find_replace_templatesets("stats", '#\$footer#', "\$server_stats\n\$footer");

Thanks Big Grin Big Grin You're good Toungue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)