TinyPortal

Development => Support => Topic started by: darkspreader on July 05, 2010, 06:28:36 PM

Title: Email Templates
Post by: darkspreader on July 05, 2010, 06:28:36 PM
Link to my site: http://elitecm.net/forums/
SMF version: 1.1.11
TP version: 1.0 b5.2 (it says 5.1 at the bottom?)
Theme name and version: Silentwave 1.1 (modified)
Browser Name and Version: Firefox 3.6.6
Mods installed:
phpBB3_Login_Fix
Admin Notepad
Member Color Link
SMF Staff Page
Select Admin for Notifications
Version Emulate Dropdown
View Single PM
Visual Verification Options
Enhanced Quick Reply Box
TinyPortal
Related Error messages: None

I originally posted this question on the Simple Machines forum here (http://www.simplemachines.org/community/index.php?topic=388895.msg2687013#msg2687013), but their support has gone down the shitter. I am turning towards Tinyportal, as a much more responsive and helpful team, to ask this question.

I am looking to change various email templates that are auto-generated, mainly these: all the register emails and the PM notification email.

I found where the text resides, in /Themes/default/languages/PersonalMessage.english.php, however I cannot find where the autogenerated link is shown to go back to the PM reply page. What I want to do is change the link so that it goes to the view PM page, instead of instantly going to the reply page with the previous PM in quotes. As for the register emails, I simply want to add some text and links, to show where the rules of the forum are, etc.

Thanks!
Title: Re: Email Templates
Post by: Lesmond on July 05, 2010, 06:46:24 PM
Welcome darkspreader to the TinyPortal Support site.

I am not sure, but I would think they are in one of the other "somefile-english.php" files somewhere, other than the "PersonalMessage.english.php" file, maybe someone knows better, I just dont have time right now to go through them all :o
Title: Re: Email Templates
Post by: darkspreader on July 05, 2010, 06:50:10 PM
I've looked through a few of them, but they all contain regular text, and no script URLs such as "?action=blahblah". I will keep looking.

Edit: I've looked through all of them, and they don't contain any of that information. I have a feeling that those script URLs are somewhere else.
Title: Re: Email Templates
Post by: Lesmond on July 05, 2010, 07:28:31 PM
I too have just had a search through the files, and I cant seen to find where they are sent from, I bet its somewhere simple  :tickedoff:
Title: Re: Email Templates
Post by: Lesmond on July 05, 2010, 07:38:55 PM
Not sure if this is the right one, try subs-post.php
Title: Re: Email Templates
Post by: darkspreader on July 05, 2010, 07:48:52 PM
That looks like that's the right one! I'll post back whenever I successfully get this all changed around!
Title: Re: Email Templates
Post by: Lesmond on July 05, 2010, 08:00:19 PM
look around lines 839 > 842 in subs-post.php
Title: Re: Email Templates
Post by: darkspreader on July 05, 2010, 08:11:49 PM
Okay, I almost got it working, but some of the variables I have in the link aren't getting parsed because they're a part of a mod.

I am trying to replace this:

$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;sa=send;f=inbox;pmsg=' . $ID_PM . ';quote;u=' . $from['id'];


with this:

$mailmessage .= "\n\n" . $txt['instant_reply'] . ' ' . $scripturl . '?action=pm;f=' . $context['folder'] . ';l=' . $context['current_label_id'] . ';p=' . $context['sl-singlepm'];


The link gets parsed correctly, but the variables aren't being included. The variables in the link are:

$context['folder']
$context['current_label_id']
$context['sl-singlepm']


These three variables are a part of the View Single PM mod. Do I need to add these contexts somewhere so that subs-post.php knows how to parse them? Right now, the link in the email shows up as:
http://elitecm.net/forums/index.php?action=pm;f=;l=;p=

But it should be something along the lines of this:
http://elitecm.net/forums/index.php?action=pm;f=inbox;l=-1;p=1

Thanks.
Title: Re: Email Templates
Post by: Lesmond on July 05, 2010, 08:27:15 PM
Sorry but I am not a coder,   :o just an expert at copy/paste, hopefully one of our coders will drop by and have a look at this for you.
Title: Re: Email Templates
Post by: darkspreader on July 05, 2010, 08:30:32 PM
Yeah same here. I have 0 experience with PHP, but I've managed to get by with copy/pasting. Thanks anyways!
Title: Re: Email Templates
Post by: darkspreader on July 07, 2010, 03:54:39 AM
I found this in the error log when I sent myself a PM:

8: Undefined variable: context
File: /homepages/22/d239011237/htdocs/forums/Sources/Subs-Post.php
Line: 842


For now I just have the link set up to go straight to the inbox.