Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2010, 01:52 PM
Peter Ostry's Avatar
Peter Ostry Peter Ostry is offline
 
Join Date: Jul 2008
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-07-2010, 11:39 AM
Peter Ostry's Avatar
Peter Ostry Peter Ostry is offline
 
Join Date: Jul 2008
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 04-07-2010, 02:03 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #4  
Old 04-08-2010, 01:11 AM
Peter Ostry's Avatar
Peter Ostry Peter Ostry is offline
 
Join Date: Jul 2008
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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 View Post
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 View Post
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.
Reply With Quote
  #5  
Old 04-22-2010, 05:09 PM
Peter Ostry's Avatar
Peter Ostry Peter Ostry is offline
 
Join Date: Jul 2008
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
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 02:11 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.03740 seconds
  • Memory Usage 2,197KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • postbit_imicons
  • 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