Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 07-13-2002, 12:41 AM
native son native son is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How do i make [postusername] show [field1]?

Hi, i'm helping run a private clan board and we're trying to get the "Thread Starter" and "Last Post" areas on the threads display and forums display lists to show who posted by rank instead of the username.

we've assigned ranks through custom profile field 1 (we replaced the Bio part with it) and made it so that the members can't change it. Now we're just trying to insert that [field1] into the "Thread Starter" and "Last Post" areas. i looked at the code and i think i'm replacing [postusername] but just replacing it with [field1] doesnt work

any ideas?

thanks in advance!
Reply With Quote
  #2  
Old 07-13-2002, 09:37 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, i think theres a hack out, which allows something like that, for customizable usernames in profilefields (account != username then )

don't know how it was called, but give it a try and search
Reply With Quote
  #3  
Old 07-15-2002, 12:11 PM
native son native son is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ya i tried, i think it was Firefly's method of changing the username into a profilefield, but thats not exactly what i wanted =\ i didnt want to change all usernames into rank....just show the rank on the thread starter and last post areas.

thanks for the look tho
Reply With Quote
  #4  
Old 07-19-2002, 08:09 PM
native son native son is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^
Reply With Quote
  #5  
Old 08-22-2002, 01:39 PM
native son native son is offline
 
Join Date: May 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #6  
Old 08-22-2002, 02:17 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

open newthread.php

find:

PHP Code:
      $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')"); 
replace with:

PHP Code:
      $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($bbuserinfo[field1])."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')"); 
open newreply.php

find:
PHP Code:
          $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
        } else {
          
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($bbuserinfo[field1])."' WHERE threadid='$threadid'");
        }
      } 

replace with:

PHP Code:
          $DB_site->query("UPDATE thread SET lastpost='".time()."',replycount='$replies[replies]',lastposter='".addslashes($bbuserinfo[field1])."' WHERE threadid='$threadid'");
        } else {
          
$DB_site->query("UPDATE thread SET lastpost='".time()."',replycount=replycount+1,lastposter='".addslashes($postusername)."' WHERE threadid='$threadid'");
        }
      } 
you can try this code... but im not sure if it will effect editing posts because what this code change automatically does is insert the field1 code instead of the username... hope that helps... didn't test it though...regards...

g-force2k2
Reply With Quote
  #7  
Old 08-22-2002, 05:29 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

g-force: nice idea, but effect will be gone if he update counters....
but it's a good and easy method...

edit: i found out a method to work correct for lastposter and one method to work correct for thread starter, but these are not combinable (at least not with my mysql skills)
Reply With Quote
  #8  
Old 08-23-2002, 12:57 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

regards Xenon always a step ahead of me with thinking but you can always just add a new query to the thread and post tables then and store the field1 data there and then make the following changes in the forumdisplay and forumhome templates or what ever else is necessary that way it'll avoid the update counters

g-force2k2
Reply With Quote
  #9  
Old 08-23-2002, 10:28 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, that'll do the trick

or you can modify the update-counter file to show fiel1 data there, too

Also a JOIN QUERY in forumdisplay i'd say would be better, but as said, just works for one of the two
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:36 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.04177 seconds
  • Memory Usage 2,256KB
  • 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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete