Guild Recruitment and Application Block 2.0

phpNuke integration forum

Guild Recruitment and Application Block 2.0

Postby natbur » Sat Jun 09, 2007 7:02 am

Now available in the Download Area!

After a brief respite, I'm back, and should be for awhile. I've uploaded a new copy of the beta with the missing exampleWrapper.php file included, and a minor change to the /admin/modules/*.php files to remove a global from the wrapper.

2.3.0.beta is now attached to this post. I'd like some help in testing it before I'm willing to replace version 2.2.2. While there should be no visible differences in how the module is displayed, and no changes to the database, every PHPNuke specific function has been wrapped by a local function and the originals moved into phpNukeFunctions.php. There is also a file called exampleWrapper.php that is a stripped down version of phpNukeFunctions.php(it's nonfunctional) that I commented on each line what would be needed to create a port.
Hopefully, with the new changes, the only file that would have to be modified/created would be a (PHPBB/e107/etc)functions.php file and a line added to functions.php.
I'm also asking for help in creating these function.php files. I'll work on them myself over the coming months, but I'm only familiar with PHPNuke, so it'll be slow going.

It would appear that my decision to tweak a few things in the module went a bit overboard! Everything except validateEmailFormat.php went under the knife and was, generally, completely rewritten from scratch. Why? Well, I wanted to make it more flexible for you out there who aren't comfortable editing code. The entire module is now driven out of a database, and everything can be configured in the new admin module. The database name has changed, as well as it's structure, so those of you who have the old version of the recruitment block will want to completely remove it before an upgrade. Let me know what you guys think about this, and if you notice any bugs!

Changes in 2.3.0.beta
- Created functions.php that's called from every file which contains filter_html and redirects to individual CMS function files
- Collected every PHPNuke specific file into phpNukeFunctions.php
- Added a stand-alone filter_html() based off of phpNukes filter_text()
- Added a $noHTML variable that strips out ALL, html, not just unallowed

Changes in 2.2.2
- Changed KeyType display so that it blends more universally with various themes
- Fixed a problem with update_MYSQL_db.php that caused it to fail
- Fixed a problem with PHP5 compatibility
- Fixed a bug that caused special characters to be escaped in e-mails

See readme.txt for a complete changlog
Attachments
application_and_recruitment2.3.0.beta.rar
(73.93 KiB) Downloaded 613 times
Last edited by natbur on Sun Jul 15, 2007 3:19 am, edited 26 times in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Re: Guild Recruitment and Application Block 2.0

Postby Orthon » Sun Jun 10, 2007 8:39 am

i get the error

Parse error: syntax error, unexpected '=', expecting ')' in /***/****/****l/*****/modules/Application/variables.php on line 3

when clicking on the application icon in the admin section

Thanks for any help
Orthon
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun May 27, 2007 7:15 am

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Sun Jun 10, 2007 9:01 am

line 3 should read
Code: Select all
function initialize(&$Variables "", &$KeyData "", &$TextBoxData ""

What version of PHP are you using on your host?
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Re: Guild Recruitment and Application Block 2.0

Postby Orthon » Sun Jun 10, 2007 4:44 pm

the version of php is 4.4.6

Thanks
Orthon
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun May 27, 2007 7:15 am

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Sun Jun 10, 2007 9:48 pm

I downgraded my test site to 4.4.7 and got the same error that you did. I'm looking into it to see what I need to change to get default arguments to work in PHP4.

PHP4 doesn't like default arguments when passing by reference...
Last edited by natbur on Sun Jun 10, 2007 10:41 pm, edited 1 time in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Sun Jun 10, 2007 10:07 pm

I've change that function definition in 2.0.3, the module should now be compatible with PHP4. If you run into any other issues with it, just give me a shout.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Re: Guild Recruitment and Application Block 2.0

Postby Orthon » Mon Jun 11, 2007 6:52 am

still get the same error :scratch:
Last edited by Orthon on Mon Jun 11, 2007 6:53 am, edited 1 time in total.
Orthon
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun May 27, 2007 7:15 am

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Mon Jun 11, 2007 7:07 am

The application currently has several problems working with PHP4. In a future update I hope to have throughly wrung them out.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Guild Recruitment and Application Block 2.0

Postby Nahri » Mon Jun 11, 2007 1:45 pm

i use nukeevo. for my forums and whatnot will this still work ok like the old version or do I need to make some changes? Thanks in advance
Nahri
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Sat Apr 14, 2007 8:40 am

Guild Recruitment and Application Block 2.0

Postby Ymryl » Mon Jun 11, 2007 10:01 pm

Natbur,
I downloaded and installed your stuff last night. I like what you have done and I am looking forward to future releases. I also ran into the PHP4 issue when I first installed. Luckily, my webhost runs both PHP4 and PHP5 so I temporarily switched to PHP5 so I could take a look (unfortunately, some of my forum mods have issues with PHP5 so I cannot stay with it). I had an issue submitting the form,it kept telling me to fill in the required items (even though they were filled in). I didn't look into the code too much but you may want to specify which required item is missing.

I have a request for a future mod. Currently when an app is submitted we post it in the forum and add a poll to the posting "Approve Application?" with "Yes, No, Abstain" as options. It would be nice to have that added automagically.

It's really cool to see how everyone took my stuff and ran with it :)
User avatar
Ymryl
WR.net Apprentice
WR.net Apprentice
 
Posts: 38
Joined: Mon Jul 17, 2006 11:45 pm
Location: RI, USA

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Tue Jun 12, 2007 12:50 am

I'm working on getting the PHP4 issues ironed out. The root of the problem is my extensive use of foreach loops to modify data (primarily in confirm.php). In php5 foreach($array as &$row) creates a reference to that row of the array, allowing you to edit it, but php4 doesn't allow this. Did you make any changes to the form after you installed it? Or was it giving you the required error right off the bat? As for marking them, required items turn red if you don't fill them out. I'll dump my test app, reinstall from scratch, and see if I can replicate the problem.

Resist and Build aren't show up, I thought I fixed it already, but I guess I overrode the file with something else...fixing it now.
Last edited by natbur on Tue Jun 12, 2007 1:21 am, edited 1 time in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Guild Recruitment and Application Block 2.0

Postby natbur » Tue Jun 12, 2007 1:28 am

ah...hrm...it would appear that that it the download wasn't getting updated...no wonder you guys were still having problems...

I'll try to track down the things I fixed yesterday and redo them
Last edited by natbur on Tue Jun 12, 2007 1:43 am, edited 2 times in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Tue Jun 12, 2007 1:55 am

Ymryl wrote:Natbur,
I downloaded and installed your stuff last night. I like what you have done and I am looking forward to future releases. I also ran into the PHP4 issue when I first installed. Luckily, my webhost runs both PHP4 and PHP5 so I temporarily switched to PHP5 so I could take a look (unfortunately, some of my forum mods have issues with PHP5 so I cannot stay with it). I had an issue submitting the form,it kept telling me to fill in the required items (even though they were filled in). I didn't look into the code too much but you may want to specify which required item is missing.

I have a request for a future mod. Currently when an app is submitted we post it in the forum and add a poll to the posting "Approve Application?" with "Yes, No, Abstain" as options. It would be nice to have that added automagically.

It's really cool to see how everyone took my stuff and ran with it :)


The poll should be doable, the forum posting is accomplished through a gutted version of phpBB's forum post function. I'll just need to find which function creates the polls and integrate that too. Actually, now that I'm thinking about it, I think poll creation was the majority of what got ripped out :p
Last edited by natbur on Tue Jun 12, 2007 1:56 am, edited 1 time in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Guild Recruitment and Application Block 2.0

Postby Ymryl » Tue Jun 12, 2007 2:30 am

I just added the forum posting and poll to my existing confirm.php file. I just added the poll stuff back in to your stuff:
Code: Select all
//
// Post a new topic/reply/poll or edit existing post/poll
//

   $forum_id = 9; //Post to forum #9 - Application forum
   $subject = $Name2 . " - " . "Lvl." . $Level . " " . $Class;
   $poster_id = 286;
   $poll_title = "Approve Application?";  //Poll Question
   $poll_length = 0;  //Run poll for how long?  0=Indefinately
   
   submit_post($forum_id, $subject, $msg, $poster_id, $poll_title, $poll_length);
   

function submit_post($forum_id, $post_subject, $post_message, $poster_id, $poll_title, $poll_length)
   {
   global $prefix, $db;
   $current_time = time();
   $sql  = "INSERT INTO " . $prefix . "_bbtopics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', $poster_id, $current_time, $forum_id, 0, 0, 1)";// : UPDATE " . $prefix . "_bbtopics SET topic_title = '$post_subject', topic_type = 0) WHERE topic_id = $topic_id";
   if (!$db->sql_query($sql))
         echo "Error (1) while submitting application, your application has not been submitted";
   $topic_id = $db->sql_nextid();
   $sql = "INSERT INTO " . $prefix . "_bbposts (topic_id, forum_id, poster_id, post_time) VALUES ($topic_id, $forum_id, $poster_id, $current_time)";
   if (!$db->sql_query($sql, BEGIN_TRANSACTION))
         echo "Error (2) while submitting application, your application has not been submitted";
   $post_id = $db->sql_nextid();
   $sql = "INSERT INTO " . $prefix . "_bbposts_text (post_id, post_subject, post_text) VALUES ($post_id, '$post_subject', '$post_message')";// : UPDATE " . $prefix . "_bbposts_text SET post_text = '$post_message', post_subject = '$post_subject' WHERE post_id = $post_id";
   if (!$db->sql_query($sql))
         echo "Error (3) while submitting application, your application has not been submitted";
   $sql = "UPDATE " . $prefix . "_bbtopics SET topic_last_post_id='$post_id', topic_first_post_id='$post_id' WHERE topic_id=$topic_id";
   if (!$db->sql_query($sql))
         echo "Error (4) while submitting application, your application has not been submitted";

   //
   // Add poll
   //
   
   $sql = "INSERT INTO " . $prefix . "_bbvote_desc (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, $poll_length)";//: "UPDATE " . $prefix . "_bbvote_desc SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id";
   if (!$db->sql_query($sql))
      {
      echo "Error (5) while submitting application, your application has not been submitted";
      }

   $poll_id = $db->sql_nextid();
   $poll_result = 0;

   //Add 1st poll option
   $poll_option_id = 1;
   $option_text = "Yes";
   $sql = "INSERT INTO " . $prefix . "_bbvote_results (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)";// : "UPDATE " . $prefix . "_bbvote_results SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
   if (!$db->sql_query($sql))
      {
      echo "Error (6) while submitting application, your application has not been submitted";
      }

    //Add 2nd poll option
   $poll_option_id = 2;
   $option_text = "No";
   $sql = "INSERT INTO " . $prefix . "_bbvote_results (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)";// : "UPDATE " . $prefix . "_bbvote_results SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
   if (!$db->sql_query($sql))
      {
      echo "Error (7) while submitting application, your application has not been submitted";
      }

   }


This works just fine for me but I am sure you'll want an array of poll options rather than the hard coded Yes and No that I threw in.

Better get back to work now.... ;)
Last edited by Ymryl on Tue Jun 12, 2007 3:25 am, edited 2 times in total.
User avatar
Ymryl
WR.net Apprentice
WR.net Apprentice
 
Posts: 38
Joined: Mon Jul 17, 2006 11:45 pm
Location: RI, USA

Re: Guild Recruitment and Application Block 2.0

Postby natbur » Tue Jun 12, 2007 2:31 am

Works!

Lol, yeah, i'm actually nearly done myself, here's what I came up with:
Code: Select all
function submit_post($forum_id$post_subject$post_message$addPoll 1$pollLength 7)
{
    global 
$prefix$db;
    
$current_time time();
    
$sql  "INSERT INTO " $prefix "_bbtopics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', 1, $current_time, $forum_id, 0, 0, $addPoll)";
    if (!
$db->sql_query($sql))
            echo 
"Error 1 while submitting application, your application has not been submitted<br />Please inform the webmaster.";
    
$topic_id $db->sql_nextid();
    
$sql "INSERT INTO " $prefix "_bbposts (topic_id, forum_id, poster_id, post_time) VALUES ($topic_id, $forum_id, 1, $current_time)";
    if (!
$db->sql_query($sqlBEGIN_TRANSACTION))
            echo 
"Error 2 while submitting application, your application has not been submitted<br />Please inform the webmaster.";
    
$post_id $db->sql_nextid();
    
$sql "INSERT INTO " $prefix "_bbposts_text (post_id, post_subject, post_text) VALUES ($post_id, '$post_subject', '$post_message')";// : UPDATE " . $prefix . "_bbposts_text SET post_text = '$post_message', post_subject = '$post_subject' WHERE post_id = $post_id";
    
if (!$db->sql_query($sql))
            echo 
"Error 3 while submitting application, your application has not been submitted<br />Please inform the webmaster.";
    
$sql "UPDATE " $prefix "_bbtopics SET topic_last_post_id='$post_id', topic_first_post_id='$post_id' WHERE topic_id=$topic_id";
    if (!
$db->sql_query($sql))
            echo 
"Error 4 while submitting application, your application has not been submitted<br />Please inform the webmaster.";
    if (
$addPoll == 1)
    {
        
$poll_title "Approve Application?";
        
$sql "INSERT INTO " $prefix "_bbvote_desc (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($pollLength 86400) . ")";
        if (!
$db->sql_query($sql))
            echo 
"Error 5 while submitting application, your application has not been submitted<br />Please inform the webmaster.";
        
$poll_id $db->sql_nextid();
        
$poll_options = array(array(1"Yes"), array(2"No"), array(3"Abstain"));
        foreach(
$poll_options as $option)
        {
            
$sql "INSERT INTO " $prefix "_bbvote_results (vote_id, vote_option_id, vote_option_text) VALUES ($poll_id, {$option[0]}, '{$option[1]}')";
            if (!
$db->sql_query($sql))
                echo 
"Error 6 while submitting application, your application has not been submitted<br />Please inform the webmaster.";
        }
    }
Last edited by natbur on Tue Jun 12, 2007 3:06 am, edited 4 times in total.
User avatar
natbur
WR.net Apprentice
WR.net Apprentice
 
Posts: 72
Joined: Fri Apr 13, 2007 12:52 pm
Location: Texas

Next

Return to phpNuke

Who is online

Users browsing this forum: No registered users and 1 guest

cron