Log in

View Full Version : Showing a user in a Phrase


traderx
09-29-2004, 02:48 AM
Hello...

First off... I am totally lost to php, so pls bear with me

I have installed this hack from Ted S (http://www.moderninsider.com/article54.html).

What is does is will post a message for people not reg'd/vistors, another one waiting activation, another message after your activation (to congrats... remind to post) and another one if you have been gone for X amount of days.

If uses Phrase, and it is what is in these Phrases that the user will see.

Example
welcome_postmoreoften
Hello {1} it appears that you have not posted on our forums in several weeks, why not take a few moments to ask a question, help provide a solution or just engage in a conversation with another member in any one of our over 200 forums. A few popular destinations include our <A
href="/f2.html">Basic Scuba</A> forums, our <A href="/f51.html">Off Topic</A> and our <A href="/f42.html">Scuba Clubs</A> which now number over two dozen.
What what I can tell, is that by adding the {1} would post the username.... but when I do that, I get:

Hello %1$s it appears that you have not posted on our forums in several weeks, why not take a few moments to ask a question,
help provide a solution or just engage in a conversation with another member in any one of .......

Am I miss understand this or did I do something wrong. I so.... what can I do to correct this, or what is the correct "thing" to put in there.

Any help would be great, and thanks in advance
Coll

Tekton
09-29-2004, 12:49 PM
can you just put '$bbuseirfo[username]' in there?

Also, over 200 forums??

traderx
09-29-2004, 01:47 PM
can you just put '$bbuseirfo[username]' in there?

Also, over 200 forums??

I have tried that..... but it doen'st work.... It just post it's self

I don't have 200 forums... ted does.... I just posted the whole as created by Ted

I know that it can be done.... Teds does.

Any other ideas

Zachery
09-29-2004, 02:43 PM
As i said, just hardcode the text and dont bother with the phrase. if $bbuserinfo[username] still doesnt work after directly putting it into the template, theres a good chance youll need to make a few minor edits to makeit work

traderx
09-30-2004, 02:10 AM
As i said, just hardcode the text and dont bother with the phrase. if $bbuserinfo[username] still doesnt work after directly putting it into the template, theres a good chance youll need to make a few minor edits to makeit work

I guess I was totally not understanding what the site said.

What exactly would I have to do in order for this to happen for I can have the users name if/when that phrase pops up.

Coll

nexialys
09-30-2004, 02:36 AM
this is a simple feature... use this example:

$message = construct_phrase($vbphrase['welcome_postmoreoften'], $bbuserinfo['username']);
this have to be used where you create the phrase to be sent to the user.

also.. the more you add variables to the function construct_phrase, the more {1}, {2} etc... you have. the scheme is:
$result = construct_phrase($vbphrase['thephrase'], {1}, {2}, {3});

..good luck! - btw, good hack to release when you know how to deal with it!

Zachery
09-30-2004, 03:05 AM
I guess I was totally not understanding what the site said.

What exactly would I have to do in order for this to happen for I can have the users name if/when that phrase pops up.

Coll
type the text into the template, and dont bother with a phrase...

nexialys
09-30-2004, 04:14 AM
type the text into the template, and dont bother with a phrase...
you, english man, with your rude manners... ;) ;)