Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-24-2014, 09:38 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Plugin Backend

Hey everyone. So lately I've been searching for someone to do this for me but I figure if I learned it myself it'd be much more helpful to me in the future. I run a gaming clan, and we have a roster. You can view it here: http://www.zealotgaming.com/forum/pages.php?pageid=15

Obviously, you can see a few things. The default page lists all our staff. That is very easy, and not really the part I need help with. The help begins with the games list you see at the side. When you click a game, it lists all users who have that Game listed as their Main Game in a profile field, and lists other info, such as their rank, In-Game contact (which is another profile field) and join date/last active. The games are also themselves divided into categories.

Our code is relatively simple. We keep a manual array of info that keeps these together you can see below:

PHP Code:
    // Define Games and Lists //
        
$gameslist = array();
        
        
//SETUP $gamelist[] = array("Game Name","urlshortcode","Name of In-Game Name or Account", "field# for that profile field");
        
    
$gameslist[] = array("Battlefield 4 (PS4)""bf4ps4""PlayStation ID""field7");
        
$gameslist[] = array("Counter Strike: Global Offensive (EU)""csgoeu""Steam ID""field8");
    
$gameslist[] = array("Counter Strike: Global Offensive (NA)""csgona""Steam ID""field8");
    
$gameslist[] = array("Elder Scrolls Online (NA)""esona""Main Character""field45");
    
$gameslist[] = array("League of Legends (EUNE)""loleune""Summoner Name""field12");
    
$gameslist[] = array("League of Legends (EUW)""loleuw""Summoner Name""field31");
    
$gameslist[] = array("League of Legends (NA)""lolna""Summoner Name""field32");
        
$gameslist[] = array("League of Legends (OCE)""loloce""Summoner Name""field47");
    
$gameslist[] = array("Minecraft""mc""Username""field14");
    
$gameslist[] = array("Smite (EU)""smiteeu""Smite Account""field22");
        
$gameslist[] = array("Smite (NA)""smitena""Smite Account""field22");
        
$gameslist[] = array("Titanfall""tfall""Origin ID""field29");
        
$gameslist[] = array("WildStar (EU)""wseu""Main Character""field48");
        
$gameslist[] = array("WildStar (NA)""wsna""Main Character""field48");
        
$gameslist[] = array("World of Tanks (EU)""woteu""WarGaming.NET ID""field46");
    
$gameslist[] = array("Other Game""other""""");
    
        
// Game Type Categories
        
$gamecats = array();
        
// ADD the # of the game in the list above (starting from 0) to the appropriate category array number list.
    
$gamecats[] = array("Divisions",array(4,5,6));
    
$gamecats[] = array("Guilds",array());
    
$gamecats[] = array("Gaming Groups",array());
    
$gamecats[] = array("Divisions in Development",array(0,1,2,3,7,8,9,10,11,12,13,14));
    
$gamecats[] = array("Miscellaneous",array(15)); 
This gets tedious to keep track of manually, and my admins with no programming experience can barely understand what is happening.

The listing of users is very easy, and I do not need any help with that. What I would like to add is a manager in the admin panel where you could save the information listed above to a table such as PREFIX.games. I imagine having several drop down boxes. A mockup is below:



I'd then Like a list of games that includes these rows in the table with a [ ] Remove checkbox.

I do not know how to add this to the admin panel and would love guidance on how to begin doing this. The sorting would go by Game Status (the second array in my php code) then Alphabetical. This would go a long way in helping my staff edit this list themselves. Any help would be appreciated.

Skype: j.c.will my be better to work personally with me.
Reply With Quote
  #2  
Old 06-24-2014, 10:02 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please post this to the correct forum/section
Reply With Quote
  #3  
Old 06-24-2014, 10:08 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
Please post this to the correct forum/section
Why not point the poster to the correct section?
Reply With Quote
  #4  
Old 06-24-2014, 10:08 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This seemed like the correct section? For general help. Isn't this help? o.O

Forum description: "How do I do this in vBulletin?"

I am asking how do I add a backed plugin in vBulletin. So I am in the correct forum.

But thank you anyhow. Your comment was clearly insightful and helpful.
Reply With Quote
  #5  
Old 06-24-2014, 10:26 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
Why not point the poster to the correct section?
because I was busy only had time to write a quick message

--------------- Added 25 Jun 2014 at 00:28 ---------------

Quote:
Originally Posted by KGodel View Post
This seemed like the correct section? For general help. Isn't this help? o.O

Forum description: "How do I do this in vBulletin?"

I am asking how do I add a backed plugin in vBulletin. So I am in the correct forum.

But thank you anyhow. Your comment was clearly insightful and helpful.
If you need to ask any questions about a plugin you need to post in the topic for the plugin as I did point out in one of your other posts. If it is a plugin you want made then either in unpaid or paid section (depends how much coding is needed)
Reply With Quote
  #6  
Old 06-24-2014, 11:08 PM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not looking for someone to create this forum me. It is not an existing plugin. I am asking on how to create part of a plguin, which qualifies as "how do you do this" in vbulletin. Please read my posts and understand what I am asking before you make claims about my goals or purposes.

I would respectfully appreciate it if you would leave the thread alone unless you are here to offer help with the question I have asked.
Reply With Quote
  #7  
Old 06-24-2014, 11:27 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Asking how to create part of a plugin is still asking for help with someone doing coding for you either free or paid and really no need to be rude I am trying to help
Reply With Quote
  #8  
Old 06-25-2014, 12:00 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ForceHSS View Post
because I was busy only had time to write a quick message

--------------- Added 25 Jun 2014 at 00:28 ---------------
Then perhaps it would be wise to not answer a post, if you don't have the time to help correctly. I know you mean well, but the way you go about if sometimes leave a lot of open ended nonsense, which leads to quite a bit of back and forth nonsense.
Reply With Quote
  #9  
Old 06-25-2014, 12:30 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes sometimes I do its just the way I am but I do like and try to help even if it takes a while to get to the point
Reply With Quote
Благодарность от:
ozzy47
  #10  
Old 06-25-2014, 01:29 AM
KGodel's Avatar
KGodel KGodel is offline
 
Join Date: May 2011
Location: Indiana
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not asking anyone to code for me, I am asking for the first step of how to go about doing the back end. Anyone in this forum who asks questions about code could be said the same thing "you are asking about code, go pay someone". I am hoping someone can point me in the right direction to design a backend myself.

--------------- Added [DATE]1403673493[/DATE] at [TIME]1403673493[/TIME] ---------------

So far, I've gotten this far:

PHP Code:
<?php
// Rosters
// by DrMath
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('style');
$specialtemplates = array('products');

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(
DIR '/includes/adminfunctions_template.php');

$this_script 'rosters';

$rpm_ver 1.0;

$rpm_mouseover_fontcolor '#D04850';

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminforums'))
{
    
print_cp_no_permission();


print_cp_header();


// Get Profile Fields //
$sql "SELECT profilefieldid FROM " TABLE_PREFIX "profilefield";
$result $db->query_read($sql);
$fields = array();
while( 
$a mysql_fetch_array($result) ) {
    
$fields[] = "field" $a[0];
}

// Get Main Games //
$sql "SELECT profilefieldid, data FROM " TABLE_PREFIX "profilefield WHERE profilefieldid = 5";
$result $db->query_read($sql);
$gamesbase mysql_fetch_array($result);
$gamesbase unserialize($gamesbase[1]);
foreach (
$gamesbase as $game) {
        
$games[] = $game;
}

// Game Status //
$gamestatuses = array('Divisions''Guilds''Divisions in Development''Miscellaneous');

/////////////////////// front page
if ( empty($_REQUEST['do']) ) {
    
print_form_header($this_script'add');
    
print_table_header('Add Game');
    
print_select_row('Main Game''game'$games );
    
print_input_row('Abbreviation''abbrev');
    
print_input_row('Account Name''acctname');
    
print_select_row('Account Profile Field''proffield'$fields);
    
print_select_row('Game Status''status'$gamestatuses);
    
print_submit_row('Submit New Game');
}

////////////////////// get current games
$sql "SELECT * FROM " TABLE_PREFIX "gamelist";
$result $db->query_read($sql);
print_form_header($this_script'remove');
print_table_header('Current Games in Roster',6);
echo 
"<tr><th>Game</th><th>Abbreviation</th><th>In-Game Name</th><th>Profile Field</th><th>Status</th><th>Delete?</th></tr>";
while (
$game mysql_fetch_array($result)) {
    echo 
"<tr>
            <td>
$game[1]</td>
            <td>
$game[2]</td>
            <td>
$game[3]</td>
            <td>
$game[4]</td>
            <td>
$game[5]</td>
            <td stlye='text-align:center;'><input type='checkbox' name='delete' value='
$game[0]'></td>
          </tr>"
;
}
print_table_footer(6,'','',0);

/////////////////////// add
if ( $_REQUEST['do'] == 'add' ) {
    if ( empty(
$_REQUEST['game']) OR empty($_REQUEST['abbrev']) OR empty($_REQUEST['acctname']) OR empty($_REQUEST['proffield']) OR empty($_REQUEST['status'])) { rpm_print_stop_back('Please be sure every field is filled out before submitting.'); }
    
    
$game $_REQUEST['game'];
    
$abbrev $_REQUEST['abbrev'];
    
$acctname $_REQUEST['acctname'];
    
$proffield $_REQUEST['proffield'];
    
$status $_REQUEST['status'];
    
    
$sql "INSERT INTO TABLE " TABLE_PREFIX "gamelist (gamename, abbreviation, ingamename, profilefield, status)
           VALUES (
$game$abbrev$acctname$proffield$status)";
    
$db->query_write($sql);
    
    if (
$db->affected_rows() != 0) {echo "Game Added!";} else { $db->error();}
}

print_cp_footer();
?>

So now that these are populated how I'd like I can created an "add" post and run the query to add it to a new table yea? Now can anyone tell me how to add it to the menu on the left side and create an administrator "canadmin" property?

Also, for some reason my "add" code is not working properly. I think the DB writing isn't happening.
Reply With Quote
Благодарность от:
K4GAP
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:02 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04915 seconds
  • Memory Usage 2,342KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete