vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do i make [postusername] show [field1]? (https://vborg.vbsupport.ru/showthread.php?t=41000)

native son 07-13-2002 12:41 AM

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!

Xenon 07-13-2002 09:37 AM

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 ;)

native son 07-15-2002 12:11 PM

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 :)

native son 07-19-2002 08:09 PM

^

native son 08-22-2002 01:39 PM

anyone? :(

g-force2k2 08-22-2002 02:17 PM

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

Xenon 08-22-2002 05:29 PM

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)

g-force2k2 08-23-2002 12:57 AM

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

Xenon 08-23-2002 10:28 AM

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 ;)


All times are GMT. The time now is 03: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.00967 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete