vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   vB Staff Titles (https://vborg.vbsupport.ru/showthread.php?t=93783)

scootman 01-05-2006 03:47 PM

Install great job :) Thanks

sinaluna 01-05-2006 11:11 PM

Quote:

Originally Posted by Breath
What would be the point of that are members can use custom titles anyway?

The same reason that staff need it. Custom titles are already being used and a separate line is needed for other purposes.

Xplorer4x4 01-19-2006 03:04 PM

Quote:

Originally Posted by Breath
Ok heres's a fix for it.

Open the xml file and change

Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD (isstaffrank INT(6) UNSIGNED NOT NULL DEFAULT '')");
to

Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD (isstaffrank INT(6) UNSIGNED NOT NULL)");
This does the trick on mysql5

Just a warning that I got a datbase error when I did this and now I get one when i try to add any product.

Here is the error:
Quote:

MySQL Error : 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 '-End Error Mess = 'a:4:{s:17:\"custom_link_added\";s:44:\"The custom link has su' at line 1
Error Number : 1064

Logikos 01-20-2006 02:10 AM

Quote:

Originally Posted by Xplorer4x4
I seemed to get this error when attemptin to use on my new server which makes me thinkg it is a PHP/MySQL conflict.

MySQL V5
PHP v4.4.1 & PHP v5.1.1

Not sure which is in effect.

Code:

Database error in vBulletin 3.5.3:

Invalid SQL:
UPDATE user SET
        passworddate = FROM_UNIXTIME(1136455772),
        password = 'fb98a3830432d6ff9ad9ac5a5a1b7d4e',
        ### Bitfield: user.options ###
                options = IF(options & 8, options - 8, options),
                options = IF(options & 1024, options - 1024, options),
                options = IF(options & 16, options, options + 16),
                options = IF(options & 256, options - 256, options),
                options = IF(options & 512, options - 512, options),
                options = IF(options & 32, options - 32, options),
                options = IF(options & 2048, options, options + 2048),
                options = IF(options & 4096, options - 4096, options),
                options = IF(options & 1, options, options + 1),
                options = IF(options & 2, options, options + 2),
                options = IF(options & 4, options, options + 4),
                options = IF(options & 64, options, options + 64),
                options = IF(options & 128, options - 128, options),
                options = IF(options & 32768, options - 32768, options),
        usertitle = 'Administrator',
        customtitle = 0,
        username = 'Xplorer4x4',
        email = '',
        languageid = 0,
        homepage = '',
        birthday_search = '1984-10-22',
        birthday = '10-22-1984',
        showbirthday = 2,
        icq = '',
        aim = '',
        yahoo = '',
        msn = '',
        skype = '',
        parentemail = '',
        posts = 592,
        referrerid = 0,
        ipaddress = '',
        vbookie_cash = 500,
        ucash = '2230.54',
        isstaffrank = '0',
        staffrank = '',
        staffrank_opentag = '',
        staffrank_closetag = '',
        alerts = 0,
        warnings = 0,
        warning_level = 0,
        warning_bans = 0,
        usergroupid = 6,
        reputationlevelid = 5,
        reputation = 23,
        pmpopup = 1,
        autosubscribe = -1,
        threadedmode = 0,
        showvbcode = 2,
        styleid = 0,
        timezoneoffset = '-6',
        daysprune = 0,
        joindate = 1132099380,
        lastactivity = 1136455740,
        lastpost = 1136455620,
        membergroupids = ''
WHERE userid = 1;

MySQL Error  : Unknown column 'isstaffrank' in 'field list'
Error Number : 1054
Date                : Thursday, January 5th 2006 @ 10:09:32 AM
Script          : /admincp/user.php
Referrer        : /admincp/user.php?do=edit&u=1
IP Address  :
Username        : Xplorer4x4
Classname        : vb_database


hmmm, I've just installed on 3.5.3 and everything works fine.

Logikos 01-20-2006 02:15 AM

The only problem I saw was a incorrect phrase. Fixed and updated.

Guest210212002 01-20-2006 02:52 AM

/tag

LincolnForums 01-31-2006 08:59 PM

doesnt work on mysql5 or php5 not sure which

Xplorer4x4 02-03-2006 08:10 PM

Quote:

Originally Posted by Breath
Ok heres's a fix for it.

Open the xml file and change

Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD (isstaffrank INT(6) UNSIGNED NOT NULL DEFAULT '')");
to

Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "user ADD (isstaffrank INT(6) UNSIGNED NOT NULL)");
This does the trick on mysql5

Now I get a datbase error everytime i install ANY plug in. The error is to large to fit in this thread, so canb some one please help me repair the problem.
https://vborg.vbsupport.ru/attachmen...chmentid=42063

Dark s.s. Trunk 02-03-2006 09:47 PM

I like but i get one error it overrides the admin titles doesnt add a second.. and everything was dune to the instructions..

craiovaforum 02-04-2006 07:24 PM

can this be modified to do it per usergroup?

Wild-Wing 02-06-2006 12:43 AM

yea thats would be nice man if you did that.

amadergaan 02-06-2006 01:09 AM

are you bringing this out for 3.53 ?

Also...is there anyway to have multiple fields be displayed if the user gives inputs?

Xplorer4x4 02-06-2006 01:30 AM

Quote:

Originally Posted by amadergaan
are you bringing this out for 3.53 ?

Also...is there anyway to have multiple fields be displayed if the user gives inputs?

This is compatible with 3.5.3.

As in multiple titles? No but just use HTML to add multiple, for example, "Off Topic Mod<br />Sports Mod"

And that will pirnt out like:
Off topic Mod
Sports Mod

amadergaan 02-06-2006 01:34 AM

Quote:

Originally Posted by Xplorer4x4
This is compatible with 3.5.3.

As in multiple titles? No but just use HTML to add multiple, for example, "Off Topic Mod<br />Sports Mod"

And that will pirnt out like:
Off topic Mod
Sports Mod


thanks for the reply..i'll try it out..

Well...I have this problem...I'm trying to add group specefic custom profile fields to be displayed like this....Basically..different groups will have different custom profile field options...with input...it will be displayed in the postbit..

i hope i made some sense with the post..

Xplorer4x4 02-06-2006 01:49 AM

Quote:

Originally Posted by amadergaan
thanks for the reply..i'll try it out..

Well...I have this problem...I'm trying to add group specefic custom profile fields to be displayed like this....Basically..different groups will have different custom profile field options...with input...it will be displayed in the postbit..

i hope i made some sense with the post..

I think I understand. You want this feature but you want to apply one specific title to an entire user groups.

Try using the stock Rank System. I used to do something similar to what your asking using it.

craiovaforum 02-06-2006 09:36 AM

Quote:

Originally Posted by Xplorer4x4
I think I understand. You want this feature but you want to apply one specific title to an entire user groups.

Try using the stock Rank System. I used to do something similar to what your asking using it.

I saw a board using this but since I have some big pictures as ranks and I don't want to change them a text for each usergroup could be nice ;)

HaMaDa4eVeR 02-06-2006 10:58 AM

well done live wire

Installed :)

craiovaforum 02-06-2006 01:55 PM

I managed to do something abut it, maybe I will post a hack ;)

an example attached



see the forum: www.craiovaforum.ro

amadergaan 02-06-2006 11:03 PM

Quote:

Originally Posted by Xplorer4x4
I think I understand. You want this feature but you want to apply one specific title to an entire user groups.

Try using the stock Rank System. I used to do something similar to what your asking using it.

Well....I'm not looking to add group specific "user titles"..i already have the default User Title system...

Let me give you the example through my orum...I run a big Music forum and I have a group for "Musicians"...What i'm trying to do is lets say...add 2-3 additional custom profile fields such as "Instrument Played", "Band Name"..etc etc...the idea is..when they give an input of these fields from their UserCP, the fields will be displayed in the postbit (doesn't matter where in postbit). The only problem I'm having is that the fields are UNIVERSAL and not group specefic...anyone and add the input and it will be showed...I want to have different criteria for different groups..

Any kind of help would be appriciated...

Wild-Wing 02-08-2006 01:59 AM

well ive achieved that i think. but cant post hack till i get approval from live wire

Xplorer4x4 02-08-2006 02:20 AM

Quote:

Originally Posted by Wild-Wing
well ive achieved that i think. but cant post hack till i get approval from live wire

As long as your not releasing it on your own(like in a new thread) you can post it in this thread.


Well....I'm not looking to add group specific "user titles"..i already have the default User Title system...

Quote:

Let me give you the example through my orum...I run a big Music forum and I have a group for "Musicians"...What i'm trying to do is lets say...add 2-3 additional custom profile fields such as "Instrument Played", "Band Name"..etc etc...the idea is..when they give an input of these fields from their UserCP, the fields will be displayed in the postbit (doesn't matter where in postbit). The only problem I'm having is that the fields are UNIVERSAL and not group specefic...anyone and add the input and it will be showed...I want to have different criteria for different groups..

Any kind of help would be appriciated...
Just had an idea. Set up multiple user groups, and then allow them to be publicly joinable, and set ranks(inturment title) per usergroup.

Wild-Wing 02-08-2006 02:45 PM

ill release the code here
admin cp code
Code:

<?php

/*======================================================================*\
|| #################################################################### ||
|| # Staff Titles Hack Version 1.0.0                                      # ||
|| # ---------------------------------------------------------------- # ||
|| #                          # ||
|| # PHP Code by:  Wild-Wing                                # ||
|| #  ||
|| #                        # ||
|| #################################################################### ||
\*======================================================================*/

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'staff_titles_admin');
define('STAFFTITLE_VERSION', '1.0.0');

// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array('');

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

// ############################# LOG ACTION ###############################
//log_admin_action();
log_admin_action(($_REQUEST['usergroupid'] != 0 ? "usergroupid = ".$_REQUEST['usergroupid'] : ''));

print_cp_header("Staff Title  ".STAFFTITLE_VERSION." Admin");

if (!isset($_REQUEST['do']) || empty($_REQUEST['do'])) {
        $_REQUEST['do'] = "dotitles";
}

// ##################### LIST ALL STAFF TITLES ########################
if ($_REQUEST['do'] == "dotitles") {
       
       
        print_form_header('staff_titles_admin', 'nowhere');
        print_table_header("Staff Titles Admin");
        print_description_row("You can change usergroup staff titles here.");
        $grouptitle = $db->query_read("SELECT usergroupid, title, staffrank AS stafftitle, staffrank_opentag AS opentag, staffrank_closetag AS closetag FROM ".TABLE_PREFIX."usergroup order by usergroupid asc");
        while ($groupstitle = $db->fetch_array($grouptitle)) {
                print_form_header('staff_titles_admin', 'set_update');
                construct_hidden_code('usergroupid', $groupstitle['usergroupid']);
                construct_hidden_code('usergroup', $groupstitle['title']);
                print_table_header($groupstitle['title']." ID: ". $groupstitle['usergroupid']);
        //        print_yes_no_row($vbphrase['enable_staff_title'], 'groupstitle[isstaffrank]', $groupstitle['isstaffrank']);
                print_input_row($vbphrase['staff_title'], 'staffrank', $groupstitle['stafftitle']);
                print_label_row($vbphrase['staff_title_markup'],
        '<span style="white-space:nowrap">
        <input size="15" type="text" class="bginput" name="opentag" value="' . htmlspecialchars_uni($groupstitle['opentag']) . '" tabindex="1" />
        <input size="15" type="text" class="bginput" name="closetag" value="' . htmlspecialchars_uni($groupstitle['closetag']) . '" tabindex="1" />
        </span>', '', 'top', 'htmltags');
                print_submit_row("Set Usergroup Staff Title");
        }
        print_table_footer();
}

if ($_REQUEST['do'] == "set_update") {
$staffrank = $_REQUEST['staffrank'];
$opentag = $_REQUEST['opentag'];
$closetag = $_REQUEST['closetag'];
if ($opentag == ""){
$opentag ="";}
else{
$opentag =", staffrank_opentag='".$opentag."',";}
if ($closetag == ""){
$closetag ="";}
else{
$closetag ="staffrank_closetag='".$closetag."'";}
        $db->query_write("UPDATE ".TABLE_PREFIX."usergroup SET staffrank='$staffrank' $opentag $closetag where usergroupid =$_REQUEST[usergroupid]");//usergroup update
        $uStaff = $db->query_read("SELECT usergroupid, username, isstaffrank, staffrank AS stafftitle, staffrank_opentag AS opentag, staffrank_closetag AS closetag FROM ".TABLE_PREFIX."user where usergroupid = $_REQUEST[usergroupid]");
        while ($uStaffT = $db->fetch_array($uStaff)) {
        if ($uStaffT['isstaffrank']==0){
        $db->query_write("UPDATE ".TABLE_PREFIX."user SET staffrank='$staffrank' $opentag $closetag");//user update
        }
        else{
        $uStaffTs .= "<b>$uStaffT[username]</b>: could not be updated you have chosen to give them their own Staff Title.<br />\n";
        }
        }
        print "$_REQUEST[usergroup] Staff Title Updated and Users";
        print "<br />\n$uStaffTs";
        $_REQUEST['do'] = "dotitles";
}

//################## LIST ALL CUSTOM STAFF TITLES ######################
if ($_REQUEST['do'] == "custom") {
        print_form_header('staff_titles_admin', 'set_update');
        print_table_header("View Custom Admin Set Staff Titles");
        $userstaff = $db->query_read("SELECT userid, username, staffrank AS stafftitle, staffrank_opentag AS opentag, staffrank_closetag AS closetag FROM ".TABLE_PREFIX."user where isstaffrank = 1 order by userid asc");
        while ($userstafftitle = $db->fetch_array($userstaff)) {
        $userstafftitles .= "$userstafftitle[username] has the Staff Title of : ".$userstafftitle['opentag'].$userstafftitle['stafftitle'].$userstafftitle['closetag']."<br />\n";
        }
        print_description_row("$userstafftitles");
        print_table_footer();
}

//print_description_row();
print_cp_footer();


?>

sql note:this is comming from straight from the xml file
Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "usergroup ADD (staffrank VARCHAR(250) NOT NULL DEFAULT '')");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "usergroup ADD (staffrank_opentag  VARCHAR(250) NOT NULL DEFAULT '')");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "usergroup ADD (staffrank_closetag  VARCHAR(250) NOT NULL DEFAULT '')");

oh yea the nav group
Code:

<navgroups product="livewires_staff_titles">

        <navgroup text="Staff Titles" permissions="canadminpermissions" displayorder="121">

                <navoption displayorder="10">
                        <text>Set Usergroup Staff Titles</text>
                        <link>staff_titles_admin.php?do=dotitles</link>
                </navoption>
               
                <navoption displayorder="20">
                        <text>View Custom Set Staff Titles</text>
                        <link>staff_titles_admin.php?do=custom</link>
                </navoption>
               
        </navgroup>

</navgroups>


Nathan L 02-12-2006 10:04 AM

Great hack, installed today and working fine :)

Also added this code below so the name shows up on the memberlist, however it only shows up in the forum text colour. Not the colour chosen in the html fields. Is there anyway to make this showup in the memberlist, with the chosen colour?




Quote:

Originally Posted by optrex
in memberlist_resultsbit

find:

Code:

<if condition="$show['usertitlecol']"><div class="smallfont">$userinfo[usertitle]</div></if>
and above or below (depending where you want it add:

Code:

<if condition="$show['usertitlecol']"><div class="smallfont">$userinfo[staffrank]</div></if>


The_Rayman 02-20-2006 08:23 PM

Very very nice Hack m8!

Works like a charm

Xplorer4x4 02-21-2006 05:26 PM

PHP Code:

Database error in vBulletin 3.5.3:

Invalid SQL:
UPDATE user SET
    
### Bitfield: user.options ###
        
options = IF(options 8options 8options),
        
options = IF(options 1024optionsoptions 1024),
        
options = IF(options 16optionsoptions 16),
        
options = IF(options 256options 256options),
        
options = IF(options 512optionsoptions 512),
        
options = IF(options 32options 32options),
        
options = IF(options 2048optionsoptions 2048),
        
options = IF(options 4096options 4096options),
        
options = IF(options 1optionsoptions 1),
        
options = IF(options 2optionsoptions 2),
        
options = IF(options 4optionsoptions 4),
        
options = IF(options 64optionsoptions 64),
        
options = IF(options 128options 128options),
        
options = IF(options 32768options 32768options),
    
usertitle 'Administrator',
    
customtitle 0,
    
username 'Xplorer4x4',
    
email '',
    
languageid 0,
    
homepage 'http://www.domsforums.net/',
    
birthday_search '1984-10-22',
    
birthday '10-22-1984',
    
showbirthday 2,
    
icq '',
    
aim '',
    
yahoo '',
    
msn '',
    
skype '',
    
parentemail '',
    
posts 1097,
    
referrerid 0,
    
ipaddress '',
    
isstaffrank '1',
    
staffrank 'Tech Admin',
    
staffrank_opentag '<b>',
    
staffrank_closetag '</B>',
    
vbookie_cash 500,
    
alerts 0,
    
warnings 0,
    
warning_level 0,
    
warning_bans 0,
    
ucash '11242.37',
    
usergroupid 6,
    
displaygroupid 6,
    
membergroupids '25',
    
reputationlevelid 7,
    
reputation 167,
    
pmpopup 1,
    
autosubscribe = -1,
    
threadedmode 0,
    
showvbcode 2,
    
styleid 0,
    
timezoneoffset '-6',
    
daysprune 0,
    
joindate 1132099380,
    
lastactivity 1140546840,
    
lastpost 1140540000
WHERE userid 
1;

MySQL Error  Unknown column 'isstaffrank' in 'field list'
Error Number 1054
Date         
TuesdayFebruary 21st 2006 06:35:04 PM
Script       
: [url]http://www.domsforums.net/admincp/user.php[/url]
Referrer     : [url]http://www.domsforums.net/admincp/user.php?do=edit&u=1[/url]
IP Address   
Username     Xplorer4x4
Classname    
vb_database 

For some reason it is not adding the "isstaffrank" table under the users table.

Xplorer4x4 03-03-2006 10:33 PM

bump

kira 03-05-2006 10:59 PM

Great plugin, thank you very much, LiveWire! :)

kizzmet 03-06-2006 04:06 AM

This is an awesome hack, I edited the default font and color so I don't have to add tags each time. This is going to save me sooo much time since most of my members have more than one title to set for different reasons. Thank you.

TPOCJames 03-16-2006 11:55 PM

so this will not work for vB 3.5.x?

Jordan17 03-28-2006 05:46 PM

Thank you very much! Great hack, just what i've been looking for!

Nathan2006 03-28-2006 07:40 PM

Thank you LiveWire

This is really cool :cool:

Install:D

rareclownfish 04-04-2006 01:30 AM

when will this be working on 3.5.4?

Logikos 04-04-2006 02:33 AM

It Should

rareclownfish 04-04-2006 02:42 AM

Quote:

Originally Posted by LiveWire
It Should

Has anyone here tried it on that version?

rareclownfish 04-04-2006 03:01 AM

Works great installed

Saskia 04-04-2006 02:27 PM

Quote:

Originally Posted by rareclownfish
Has anyone here tried it on that version?

Works fine for me on my vB 3.5.4 :).

Thanks for this nice feature, really helpful!

EdQ 04-04-2006 04:14 PM

Works for me on 3.5.4

wideopen 04-05-2006 07:11 PM

It works for me ..but I have one problem ..I can't edit my my user title now?? Any clue??

On Edit: I can't change my user title in the Admin CP but I can through the Used CP

Logikos 04-05-2006 07:25 PM

Make sure your config.php file allows you to. Do you get an error message?

wideopen 04-05-2006 07:30 PM

No it just won't let me change it?? I'm not saying this Hack did it , I just noticed it after installing it.. I'll check the Config.php..Thanks

O.K. Sil;ly question ..what exacly am I looking for in the Config.php


All times are GMT. The time now is 10:12 AM.

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.01813 seconds
  • Memory Usage 1,904KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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