vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - World of Warcraft Class Recruitment Status module (db backend) (https://vborg.vbsupport.ru/showthread.php?t=137670)

NightPhoenix 02-13-2007 04:27 AM

Fatal error: Call to a member function on a non-object

Line 31 of class_recruit.php

turnipofdoom 02-13-2007 02:55 PM

Well Line 31 is blank in my file so here.

for php5 and only 5.

Code:

<?php
/*======================================================================*\
        class_recruit.php
        ------------------------------------------------------------------
       
        * Dark Portal Syndicate http://www.darkportals.com
        * Copyright 2002-2007
        * ------------------
        * class_recruit.php
        * Began: 6/27/05
        * Last Modified 1/27/2007
        * Authors: Delinah Howard, Jessica Zakhar. <site-admins@darkportals.com>
        ------------------------------------------------------------------

\*=======================================================================*/


class recruit {
       
        private $vbObj;
       
        function __construct()
                {       
                        global $vbulletin;
                        $this->vbObj =& $vbulletin;
                       
                }
               
        function getStatus( $query )
        {
               
                $result = $this->vbObj->db->fetch_array(
                                  $this->vbObj->db->query_read( "SELECT status FROM recruitment WHERE class='$query'" ) );
               
                return strip_tags( $result['status'] );
        }

       
        function setStatus( $druid,
                                                $hunter,
                                                $mage,
                                                $paladin,
                                                $priest,
                                                $rogue,
                                                $shaman,
                                                $warlock,
                                                $warrior )
        {
       
        $classes = array(
                                        'Druid' => $this->vbObj->db->escape_string( strip_tags( $druid, '<b>' ) ),
                                        'Hunter' => $this->vbObj->db->escape_string( strip_tags( $hunter, '<b>' ) ),
                                        'Mage' => $this->vbObj->db->escape_string( strip_tags( $mage, '<b>' ) ),
                                        'Paladin' => $this->vbObj->db->escape_string( strip_tags( $paladin, '<b>' ) ),
                                        'Priest' => $this->vbObj->db->escape_string( strip_tags( $priest, '<b>' ) ),
                                        'Rogue' => $this->vbObj->db->escape_string( strip_tags( $rogue, '<b>') ),
                                        'Shaman' => $this->vbObj->db->escape_string( strip_tags( $shaman, '<b>' ) ),
                                        'Warlock' => $this->vbObj->db->escape_string( strip_tags( $warlock, '<b>' ) ),
                                        'Warrior' => $this->vbObj->db->escape_string( strip_tags( $warrior, '<b>' ) )
                                        );

        foreach( $classes AS $key => $value )
                {
                        $query = ( "UPDATE recruitment SET status='$value' WHERE class='$key'" );
                        $this->vbObj->db->query( $query );
                }
        }
}
?>

and php4

Code:

<?php
/*======================================================================*\
        class_recruit.php
        ------------------------------------------------------------------
       
        * Dark Portal Syndicate http://www.darkportals.com
        * Copyright 2002-2007
        * ------------------
        * class_recruit.php
        * Began: 6/27/05
        * Last Modified 1/27/2007
        * Authors: Delinah Howard, Jessica Zakhar. <site-admins@darkportals.com>
        ------------------------------------------------------------------

\*=======================================================================*/


class recruit {
       
        var $vbObj;
       
        function recruit()
                {       
                        global $vbulletin;
                        $this->vbObj =& $vbulletin;
                       
                }
               
        function getStatus( $query )
        {
               
                $result = $this->vbObj->db->fetch_array(
                                  $this->vbObj->db->query_read( "SELECT status FROM recruitment WHERE class='$query'" ) );
               
                return strip_tags( $result['status'] );
        }

       
        function setStatus( $druid,
                                                $hunter,
                                                $mage,
                                                $paladin,
                                                $priest,
                                                $rogue,
                                                $shaman,
                                                $warlock,
                                                $warrior )
        {
       
        $classes = array(
                                        'Druid' => $this->vbObj->db->escape_string( strip_tags( $druid, '<b>' ) ),
                                        'Hunter' => $this->vbObj->db->escape_string( strip_tags( $hunter, '<b>' ) ),
                                        'Mage' => $this->vbObj->db->escape_string( strip_tags( $mage, '<b>' ) ),
                                        'Paladin' => $this->vbObj->db->escape_string( strip_tags( $paladin, '<b>' ) ),
                                        'Priest' => $this->vbObj->db->escape_string( strip_tags( $priest, '<b>' ) ),
                                        'Rogue' => $this->vbObj->db->escape_string( strip_tags( $rogue, '<b>') ),
                                        'Shaman' => $this->vbObj->db->escape_string( strip_tags( $shaman, '<b>' ) ),
                                        'Warlock' => $this->vbObj->db->escape_string( strip_tags( $warlock, '<b>' ) ),
                                        'Warrior' => $this->vbObj->db->escape_string( strip_tags( $warrior, '<b>' ) )
                                        );

        foreach( $classes AS $key => $value )
                {
                        $query = ( "UPDATE recruitment SET status='$value' WHERE class='$key'" );
                        $this->vbObj->db->query( $query );
                }
        }
}
?>


hannie 02-20-2007 01:17 PM

i can get this to come up but it doesn't appear in a module - it appears on the top of the page - any idea whats going on?

aitonk 02-20-2007 02:40 PM

I get this error when trying to add the SQL Database

Code:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1;

--
-- Dumping data for table `recr


turnipofdoom 02-20-2007 06:54 PM

Quote:

Originally Posted by hannie (Post 1186701)
i can get this to come up but it doesn't appear in a module - it appears on the top of the page - any idea whats going on?

Yeah enable clean file output in the module you created in vbadvanced.

turnipofdoom 02-20-2007 06:56 PM

Quote:

Originally Posted by aitonk (Post 1186751)
I get this error when trying to add the SQL Database

Code:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1;

--
-- Dumping data for table `recr


Code:

CREATE TABLE `recruitment` (
`Class` varchar(15) NOT NULL default '',
`Status` varchar(15) NOT NULL default '',
PRIMARY KEY (`Class`)
) ENGINE=MyISAM;

just remove 'DEFAULT CHARSET=latin1

SReid 03-10-2007 04:51 PM

Thanks for making this! Installed at www.malevolenceguild.org

Feanor 03-11-2007 07:33 PM

I can't get it to work - I've tried all the ideas in this thread, and the best I can come up with is a homepage consisting of just this:

turnipofdoom 03-12-2007 05:24 PM

Quote:

Originally Posted by Feanor (Post 1201046)
I can't get it to work - I've tried all the ideas in this thread, and the best I can come up with is a homepage consisting of just this:

Are you trying to display the recruitment status page and the update page on the same VB page? Even that should not kick that kind of error... You trying to include class_recruit more than once?

darkie79 03-13-2007 05:28 PM

I would love to install this, but it would be more beneficial to our community as a recruitment tool for specific roles within the community (ie, tournament admin/cs:s team, etc)..how hard would it be to change this to accomodate our needs?

Thanks ;)


All times are GMT. The time now is 12:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01247 seconds
  • Memory Usage 1,771KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete