MyBB Source

everyBB - The forum owners community

4,000 Members! | Small Policy Change

Latest Releases: Valid Referrals - Bonus - Mark Thread Read

 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's this error?
Author Message
trilobyte-
Premium User


Posts: 46
Joined: Nov 2008
Reputation: 0
MyBux: 122
Post: #1
What's this error?
Hey.

So I started my plugin again from scratch. Just to make sure I did everything completely right. Now for some reason I am getting a PHP error in the plugins section in ACP.

This is the error:

Code:
Fatal error: Cannot redeclare rtg_info() in /home/dotrb/public_html/forums/inc/plugins/rtg.php  on line 17

This is my code:

PHP Code:
<?php

/**
    * [R]andom [T]hread [G]enerator 1.0
    * Copyright 2010, Jordan Lovelle
    * http://mybbrunway.com
    *
    * You may not redistribute this plugin without my consent.
    * You must keep my copyright in at all times.
**/

if(!defined("IN_MYBB"))
    {
            die(
"Nice try. You can't access this file directly, idiot.");
    }
    
function 
rtg_info()
    {
        return array(
            
"name" => "Random Thread Generator",
            
"description" => "Generate a random thread and place it on the index.",
            
"website" => "http://mybbrunway.com",
            
"author" => "Jordan Lovelle",
            
"authorsite" => "http://mybbrunway.com",
            
"version" => "1.0",
            
"guid" => "",
            
"compatibility" => ""
        
);
    }

function 
rtg_activate()
    {
        global 
$db;
        
        
$rtg_group = array(
            
'gid' => 'NULL',
            
'name' => 'rtg',
            
'title' => 'Random Thread Generator',
            
'description' => 'Settings for the Random Thread Generator plugin.',
            
'disporder' => "1",
            
'isdefault' => 'no'
        
);
        
                
$db->insert_query('settinggroups'$rtg_group);
                
$gid $db->insert_id();
                
        
$rtg_setting = array(
            
'sid' => 'NULL',
            
'name' => 'enabled_rtg',
            
'title' => 'Enable?',
            
'description' => 'If yes, the random thread will be generated. If not, it will not be.',
            
'optionscode' => 'yesno',
            
'value' => '1',
            
'disporder' 1,
            
'gid' => intval($gid),
        );

        
$db->insert_query('settings'$rtg_setting);
        
rebuild_settings();

        
$rtg_setting = array(
            
'sid' => 'NULL',
            
'name' => 'fid_rtg',
            
'title' => 'Enter the FID',
            
'description' => 'Only enter the FID <i>Number</i>.',
            
'optionscode' => 'text',
            
'value' => '1',
            
'disporder' 1,
            
'gid' => intval($gid),
        );
        
        
$db->insert_query('settings'$rtg_setting);
        
rebuild_settings();
                
    }

?>

Any help would be great.

(This post was last modified: 06-07-2010 11:37 PM by trilobyte-.)
06-07-2010 11:28 PM


euantor
Designer/Themer


Posts: 501
Joined: Jun 2009
Reputation: 1
MyBux: 573
Post: #2
RE: What's this error?
What's the name of your plugin file? You have to use the name of your plugin. Say my plugin is "mytube". I'd use "function mytube_info()

Love to play XBox 360? Visit http://www.360elites.net for News, Reviews & Previews of the biggest up-coming and current games like Halo:Reach, Battlefield: Bad Company 2 and more. We have forums too!

Visit http://www.mypurebb.com/ to see some examples of my work with MyBB themes and web designs. I even sometimes take on custom jobs, so why not sign up to the forums so you know when I'm open and designing?
06-08-2010 12:00 AM
trilobyte-
Premium User


Posts: 46
Joined: Nov 2008
Reputation: 0
MyBux: 122
Post: #3
RE: What's this error?
My plugin file is called rtg.php as well. D:
Not to worry, I renamed the file and everything in it and it's working now. Thanks for the help.

(This post was last modified: 06-08-2010 08:32 AM by trilobyte-.)
06-08-2010 08:23 AM
 





Web Design | Web Design Jobs