vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to use replacement variables? (https://vborg.vbsupport.ru/showthread.php?t=239838)

Peter Ostry 04-05-2010 01:52 PM

How to use replacement variables?
 
I posted this on vbulletin.com but maybe here is a better place.
--------------

In the registration "welcome" mail I need the URL of the server as a clickable link. Not the URL of the forum, which is $vboptions[bburl] but the servername alone. I made a replacement variable called 'serverurl' that contains the PHP code for the server name:
Code:

http://<? echo $_Server['SERVER_NAME']; ?>
The vBulletin manual talks about advantages and dangers of replacement variables but I cannot find an example how to actually use them. I tried my replacement variable in the phrase of the welcome mail in various flavours:
[serverurl]
$vboptions[serverurl]
<serverurl>
etc, nothing worked.

How do I call a replacement variable?
Can I have PHP code in a replacement variable?
Is there another method to get just the URL of the server?

Peter Ostry 04-07-2010 11:39 AM

Mmh ... nobody knows that?
Impossible :)

I make it easier:

1) How do I display my own phrases in templates?
2) How do I insert PHP variables/constants into a template?

Thanks in advance,
Peter

Lynne 04-07-2010 02:03 PM

Replacement Variables are used to replace words on the pages of your site - not for emails sent out.

1) Your own phrase in a template? Create a global phrase and then call it like you do other phrases.

2) You can't put php into a template. You put php into a plugin and then put the output into a variable which you may then use in a template (assuming you register it for use in the template also).

Peter Ostry 04-08-2010 01:11 AM

Quote:

Originally Posted by Lynne (Post 2017448)
Replacement Variables are used to replace words on the pages of your site - not for emails sent out.

But there is such a $vboptions[bburl] thing in the email. How do I make my own $peteroptions[serverurl] thing?

Quote:

Originally Posted by Lynne (Post 2017448)
1) Your own phrase in a template? Create a global phrase and then call it like you do other phrases.

I assume "global phrase" means a normal phrase which is generated via "add new phrase". Please tell me if this is not true, the manual is not very clear on this subject.

And I have never called phrases myself.
What is a phrase call:
This ? [myValue]
or this ? {vb:rawphrase myValue}
or this ? $something[myValue]
(number 2 is my favorite ...)

Quote:

Originally Posted by Lynne (Post 2017448)
2) You can't put php into a template. You put php into a plugin and then put the output into a variable which you may then use in a template (assuming you register it for use in the template also).

How do I register a variable for a template, is this in the manual?
And something like {vb:raw $_SERVER['SERVER_NAME']} is not supposed to work?

Sorry for being slow. Since MODx and vBulletin I am confused with plugins, snippets, chunks, phrases, products, and so on. All of them include something from somewhere.

Peter Ostry 04-22-2010 05:09 PM

Again too much text and too many questions?

Ok, a shorter version:
What exactly do I have to do if I want the server name as a link in the text of an automated email, except of hardcoding it?


All times are GMT. The time now is 07:21 AM.

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.01076 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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