Log in

View Full Version : Messages


Hex_legend
12-13-2008, 08:00 PM
How do I create my own message replacing:

print_stop_message('no_permission');

I have tried creating a phrase like:

print_stop_message($vbphrase['myphrase']);

However, it says "cannot find phrase: myphrase"

How would I go about doing this?

Lynne
12-13-2008, 08:46 PM
You only put the name of the phrase in there. "no_permission" is the name of a phrase. The phrase must also be of type "Front-End Error Messages Phrases Containing" in order to work there.

Hex_legend
12-13-2008, 09:03 PM
You only put the name of the phrase in there. "no_permission" is the name of a phrase. The phrase must also be of type "Front-End Error Messages Phrases Containing" in order to work there.

So instead of GLOBAL, I would set it as Front-End Error Messages and I would put:

print_stop_message('myphrase');

Lynne
12-13-2008, 09:07 PM
Yes. Try that.

Hex_legend
12-13-2008, 09:14 PM
On mine, there is no Front-End Error Messages, only Error Messages so I have added it to that. It still says:

Cannot find phrase demoacp_detailsforwarded

Lynne
12-13-2008, 09:35 PM
What version are you running? I have that group in both 3.6.8 and 3.8.0. I do not see a phrase type of Error Messages in either of those versions.

Hex_legend
12-13-2008, 09:51 PM
3.8.0 rc1

Lynne
12-13-2008, 10:30 PM
That's very odd. I run 3.8.0 RC1 on my test site and it says Front-End Error Messages, not just Error Messages.

Do a search for the phrase "no_permission". What type of phrase does that show up to be? Did you try using the "no_permission" message first to see if you code works? And are you using this in either the admin panel or mod panel?

Hex_legend
12-13-2008, 10:35 PM
no_permission works, but its not that phrase I want to show lol.

Here's the screenshot for my findings

Lynne
12-13-2008, 10:45 PM
What page are you trying to do this on? And I can try to change it and see if it works for me.

You might want to search on print_stop_message. I found this that may help - Success/Error Messages (https://vborg.vbsupport.ru/showthread.php?t=196899&highlight=print_stop_message)

Hex_legend
12-13-2008, 10:50 PM
At the moment, I am working from an XML file.
I created a product, exported the XML and creating the phrases in there.
The reason I am doing it that way is because I only need the phrases, no template edits.
I can give you access to my admin control panel if you would like to see it for yourself

Lynne
12-13-2008, 10:57 PM
Try creating a phrase the normal way and see if that works. Maybe it has something to do with these phrases being in a product that is causing the problem.

Hex_legend
12-13-2008, 11:02 PM
Try creating a phrase the normal way and see if that works. Maybe it has something to do with these phrases being in a product that is causing the problem.

Ok, it works when creating the phrase under Error Messages.
Now how would I do this via the product? When people install it, they won't want to create a phrase manually.

Here is what is in the product regarding it:


<phrasetype name="Error Messages" fieldname="Error Messages">
<phrase name="demoacp_detailsforwarded" date="1215398900" username="leigh" version="1.0.0"><![CDATA[You have attempted to hack this site. Your details have been passed on to the administration team]]></phrase>
</phrasetype>

Lynne
12-13-2008, 11:19 PM
Do you have the product turned on? Have you verified the phrases show up and that you can use them? Make a regular vbulletin phrase that you can spit out on a page and verify you can use it.

I just created a phrase in Front-End Error Messages and this is what I get exporting the product xml:
<phrasetype name="Front-End Error Messages" fieldname="error">
<phrase name="test_phrase" date="1229217390" username="Lynne" version="1.0.0"><![CDATA[This is a test phrase.]]></phrase>
</phrasetype>