Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-30-2000 Last Update: Never Installs: 0
 
No support by the author.

I don't know how many of you remember back to the old off-line reader dial up BBS days, but there was an option on many of those beasts to randomly add a "tag line" from a text file to your signature. Well, I thought of this the other evening, and here is the vB implementation:

In showthread.php, find:
Code:
$signature= "\n__________________\n$userinfo[signature]";
and add
Code:
      // begin TagLine Hack
      $tagline = "\[tagline]";
      if (eregi($tagline,$signature)) {
      // create an array holding the signature components
        $tags = split($tagline,$signature);
      // output the first segment, which will be the signature line plus the constant signature
        $signature = $tags[0];
      // add the tag according to the mod of the postid
        $tagcount = count($tags)-1;
        if ($tagcount > 0) {
          $tagid = ($postid % $tagcount) + 1;
          $signature .= $tags[$tagid];
        }
      }
      // end TagLine Hack
on the next line, before the } else { statement.

In newreply.php, find
Code:
    if ($signature==1) {
      $getsig=$DB_site->query_first("SELECT signature FROM user WHERE userid=$userid");
      $previewmessage.=bbcodeparse("\n__________________\n$getsig[signature]",0,$allowsmilies);
    }
and change it to
Code:
    if ($signature==1) {
      $getsig=$DB_site->query_first("SELECT signature FROM user WHERE userid=$userid");

      // begin TagLine Hack
      $tagline = "\[tagline]";
      $tagsignature = $getsig[signature];
      if (eregi($tagline,$tagsignature)) {
      // create an array holding the signature components
        $tags = split($tagline,$tagsignature);
      // output the first segment, which will be the signature line plus the constant signature
        $tagsignature = $tags[0];
      // don't show any taglines in Preview mode
      }
      // end TagLine Hack

      $previewmessage.=bbcodeparse("\n__________________\n$tagsignature",0,$allowsmilies);
    }
In newthread.php, find
Code:
    if ($signature==1) {
      $getsig=$DB_site->query_first("SELECT signature FROM user WHERE userid=$userid");
      $previewmessage.=bbcodeparse("\n__________________\n$getsig[signature]",0,$allowsmilies);
    }
and change it to
Code:
    if ($signature==1) {
      $getsig=$DB_site->query_first("SELECT signature FROM user WHERE userid=$userid");

      // begin TagLine Hack
      $tagline = "\[tagline]";
      $tagsignature = $getsig[signature];
      if (eregi($tagline,$tagsignature)) {
      // create an array holding the signature components
        $tags = split($tagline,$tagsignature);
      // output the first segment, which will be the signature line plus the constant signature
        $tagsignature = $tags[0];
      // don't show any taglines in Preview mode
      }
      // end TagLine Hack

      $previewmessage.=bbcodeparse("\n__________________\n$tagsignature",0,$allowsmilies);
    }
The newthread.php and newreply.php changes are subtly different from the showthread.php change because those routines handle the signature a little differently. I decided not to show the tag line in the "preview" as the tag is supposed to be psuedo random and actually will change as new tags are added to the signature, any way.

So, how does it work? After installing the three modifications above, you change your signature from
Quote:
My Sig
to
Quote:
My Sig
[tagline]
My first tag.
[tagline]
My second tag.
[tagline]
My third tag.
It can be multiple lines, too.
[tagline]
&c
When a post is displayed, the showthread.php routine you modified, above, checks the user's signature for the [tagline] keyword (which you can change -- see the code), and selects, based on the index number of the post, a tag line from any number that have been entered by the user. Users who do not add tag lines to their signatures are unaffected. If you have some tag lines and never change them, the effect is that your posts display different tag lines but always the same one for each individual post. If you change or add tag lines, the modulus operation shifts them all around. The other way to implement this would be to use the random number function in PHP, but the described effect is the one that I was after (not completely random).

You can quickly test it out by just applying the showthread.php modification. This is also a good way to see in the "Preview" mode what your signature variable is outputing before it gets "arrayed" by the PHP code.

And, you can use vB Code in your tag lines so that you can even have rotating links to important messages as per eva2000's tip in another forum.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-30-2000, 09:25 PM
Guest
 
Posts: n/a
Default

As soon as the flashbacks to my bbs days stopped I hurried and put this in.. It works great..
Reply With Quote
  #3  
Old 08-30-2000, 11:15 PM
Guest
 
Posts: n/a
Default

Forgive me: I don't quite understand what this hack does? Sounds interesting, though.
Reply With Quote
  #4  
Old 08-31-2000, 12:18 AM
Guest
 
Posts: n/a
Default

I'm glad I'm not the only one! Can you explain what this does, or show us how it works?
Reply With Quote
  #5  
Old 08-31-2000, 01:56 AM
Guest
 
Posts: n/a
Default

OK, I shall try to explain (sorry, my board is behind a firewall):

My signature on this board is:
Quote:
Peter E. Humphries
That is what I typed into the Signature box in my Profile. If the hack were installed, I could change my signature to:
Quote:
Peter E. Humphries
[tagline]
Eyes in the back of my head?
[tagline]
Buy IBM!
[tagline]
Call 555-1212 for more information.
So, each time I posted (and selected the Show Signature option, of course), one of the "tag lines" would be added to my basic signature. For example, Post 1:
Quote:
Hi, just a test post.
____________
Peter E. Humphries

Eyes in the back of my head?
Post 2:
Quote:
This is another post, for convenience of my example identified as Post 2.
____________
Peter E. Humphries

Buy IBM!
And so on. Based on the PostID of the actual post, one of the tag lines is selected. On an active board, it is unlikely that your posts will cycle through the tag lines in your signature in any particularly discernable order since the PostID of each post will be somewhat random based on how many posts others have made, yet using the PostID rather than a random number lends some stability to the appearance and behaviour.

This was a popular feature in the early 1990's when off line readers were making dial up BBS access faster and more flexible. In vB, administrators and moderators might find it useful to create a carousel of links, and users might have some fun with quotes or jokes in their tag lines (rather than massive missives trying to jam everything in ).
Reply With Quote
  #6  
Old 08-31-2000, 02:01 AM
Guest
 
Posts: n/a
Default

It is obvious too me what it does - but I was already pondering making a random signature hack.
Reply With Quote
  #7  
Old 08-31-2000, 02:08 AM
Guest
 
Posts: n/a
Default

I thought about that, and I think that it might be best implemented as another check box under Show Signature, because I might not really want random quotes, jokes, links or advertisements showing up on serious posts, but I would probably still prefer to use my regular signature rather than typing it in (it is sooo long, after all! ).
Reply With Quote
  #8  
Old 08-31-2000, 02:41 AM
Guest
 
Posts: n/a
Default

well maybe then a outlook express like signature selection check box...

so when you post

- show signature #1
- show signature #2
- show signature #3

and have those specified in the member profile ?
Reply With Quote
  #9  
Old 08-31-2000, 12:38 PM
Guest
 
Posts: n/a
Default

Thinking on it a little more, it would be pretty simple to change the Show Signature check box into a list box with the selections
  • No Signature
  • Regular Signature
  • Random Tagline
  • Tag Line 1
  • Tag Line 2
  • Tag Line 3
  • &c
Don't hold your breath, unless this has really tweaked rangersfan's interest.
Reply With Quote
  #10  
Old 08-31-2000, 09:43 PM
Guest
 
Posts: n/a
Default

/me likes idea
Reply With Quote
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 10:32 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.04313 seconds
  • Memory Usage 2,276KB
  • Queries Executed 23 (?)
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
  • (6)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (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_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
  • 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