[mod] different text strings for strThisLink = this link

3rd party code for phpList

[mod] different text strings for strThisLink = this link

Postby rrcatto » 3:48pm, Tue 08 Aug, 2006

[SUBSCRIBE]
[UNSUBSCRIBE]
[PREFERENCES]
[FORWARD]

are all replaced in the email body with "this link"

the global variable (set in english.inc) holds this value:

$strThisLink = 'this link';

this leads to inefficiency.

all i want in the body of the email is

subscribe | unsubscribe | update profile | forward

essentially, phplist needs to allow individual users to customise what text is substituted into the email body for the above placeholders ( [SUBSCRIBE] etc.)

I can do this by editing the php code myself, but of course, then all my changes will be lost when an upgrade comes out.
rrcatto
phpLister
 
Posts: 9
Joined: 3:41pm, Thu 27 Jul, 2006

Postby Hernol » 4:00pm, Tue 08 Aug, 2006

An easy way is to edit the html code and insert a link in each word, don't you think?
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Postby rrcatto » 4:02pm, Tue 08 Aug, 2006

you clearly don't understand the problem, Hernol.
rrcatto
phpLister
 
Posts: 9
Joined: 3:41pm, Thu 27 Jul, 2006

Postby Hernol » 4:26pm, Tue 08 Aug, 2006

rrcatto wrote:you clearly don't understand the problem, Hernol.

Jajajaja, ok ok, you are right.
So only hack the code and use your changes.
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Postby rrcatto » 1:06am, Thu 10 Aug, 2006

i made changes to english.inc and sendemaillib.php

i added extra $strThisLink variableS for 4 types of placeholders:

[SUBSCRIBE]
[UNSUBSCRIBE]
[FORWARD]
[PREFERENCES]

then I modified the sendEmail function in sendemaillib.php to use those variables instead of $strThisLink in each case.

english.inc [ additional variables ]
$strThisLinkSubscribe = 'SUBSCRIBE';
$strThisLinkUnsubscribe = 'UNSUBSCRIBE';
$strThisLinkForward = 'FORWARD';
$strThisLinkPreferences = 'UPDATE PROFILE';

I kept the ThisLink part intact to make it easier for me to locate the new variables in the modified code.

I would suggest that this facility (to be able to customise what text is substituted for the above placeholders) be incorporated into future versions of phplist.
rrcatto
phpLister
 
Posts: 9
Joined: 3:41pm, Thu 27 Jul, 2006

Postby Hernol » 4:52pm, Thu 10 Aug, 2006

That's great, post it in the feature request forum or in the mantis.
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

placeholders tamed

Postby jcorbitt » 5:27pm, Sat 07 Jul, 2007

I'm not experienced w/PHP, but have a solution for the placeholders for SUBSCRIBE UNSUBSCRIBE PREFERENCES that allows customized and fully formed links, which is working in the [FOOTER] of my email template, see below.

<a href="[PREFERENCESURL]&uid=[USERID]" title="Change My Profile">Profle</a> |
<a href="[SUBSCRIBEURL]&id=1" title="Subscribe">Subscribe</a> |
<a href="[UNSUBSCRIBEURL]&uid=[USERID]" title="Unsubscribe">Unsubscribe</a>

But I need help to achieve the same solution with FORWARD. I don't know how to obtain the (&mid=) MESSAGE ID that is required for use with the FORWARDURL placeholder, which I believe would work and look like this:

<a href="[FORWARDURL]&uid=[USERID]&mid=[XXXX]" title="Forward to a friend">Forward</a>

I'm sure it is available, I just don't know how to reference/call/query it. I can implement a solution in XHTML/PHP/Javascript if someone could provide an example.
jcorbitt
phpList newbie
 
Posts: 3
Joined: 4:11pm, Fri 06 Jul, 2007

Postby johnap » 3:37am, Wed 11 Jul, 2007

rrcatto wrote:i made changes to english.inc and sendemaillib.php

i added extra $strThisLink variableS for 4 types of placeholders:

[SUBSCRIBE]
[UNSUBSCRIBE]
[FORWARD]
[PREFERENCES]

then I modified the sendEmail function in sendemaillib.php to use those variables instead of $strThisLink in each case.

english.inc [ additional variables ]
$strThisLinkSubscribe = 'SUBSCRIBE';
$strThisLinkUnsubscribe = 'UNSUBSCRIBE';
$strThisLinkForward = 'FORWARD';
$strThisLinkPreferences = 'UPDATE PROFILE';

I kept the ThisLink part intact to make it easier for me to locate the new variables in the modified code.

I would suggest that this facility (to be able to customise what text is substituted for the above placeholders) be incorporated into future versions of phplist.


Where exactly the changes need to be done ?
Be helpful & Share your experience.
I'm always there to help anybody regarding Phplist.

Trust in God.
johnap
PL Geek
 
Posts: 64
Joined: 11:11am, Tue 09 Jan, 2007

Postby cogitatio » 9:37am, Sat 21 Jul, 2007

Wouldnt it be much better to have something like this:

[UNSUBSCRIBE "Text for link"] - That would be flexible and appropriate for the footer aswell since it could render non-HTML aswell:

Text for link: link here
cogitatio
phpList newbie
 
Posts: 1
Joined: 9:35am, Sat 21 Jul, 2007

It is actually very easy

Postby Dreyer » 8:24am, Thu 30 Aug, 2007

Use the folowing code to create custom links with images or text.


For Unsubscribe:

<a href="[UNSUBSCRIBEURL]">text or image goes here</a>

For forward mail :

<a href="[FORWARDURL]">text or image goes here</a>

For Update Profile:

<a href="[PREFERENCESURL]">text or image goes here</a
Dreyer
phpList newbie
 
Posts: 1
Joined: 8:08am, Thu 30 Aug, 2007

Postby twitch » 10:52am, Thu 30 Aug, 2007

does the global change so it holds all of them
global $strThisLinkSubscribe, $strThisLinkUnsubscribe......,$PoweredByImage,$PoweredByText,$cached,

etc or do you just change them in each instance?? as below

$html["unsubscribe"] = sprintf('<a>%s</a>',$url,$sep,$hash,$strThisLinkUnsubscribe);

please help a bit bad at this PHP millarky!!
twitch
phpList newbie
 
Posts: 2
Joined: 10:40am, Thu 30 Aug, 2007

Re: It is actually very easy

Postby jcorbitt » 2:11pm, Thu 30 Aug, 2007

From my experience, the [xxxURL] format shown below works in the Template Body, but not in the Footer.
==================================================

I believe this
Dreyer wrote:Use the folowing code to create custom links with images or text.


For Unsubscribe:

<a>text or image goes here</a>

For forward mail :

<a>text or image goes here</a>

For Update Profile:

<a>text or image goes here</a
jcorbitt
phpList newbie
 
Posts: 3
Joined: 4:11pm, Fri 06 Jul, 2007

Postby twitch » 2:17pm, Thu 30 Aug, 2007

thanks for that - but i'd also love to know how to do this via the php.
twitch
phpList newbie
 
Posts: 2
Joined: 10:40am, Thu 30 Aug, 2007

Re: It is actually very easy

Postby johnap » 6:05am, Fri 21 Sep, 2007

Dreyer wrote:Use the folowing code to create custom links with images or text.


For Unsubscribe:

<a>text or image goes here</a>

For forward mail :

<a>text or image goes here</a>

For Update Profile:

<a>text or image goes here</a



Dreyer
its the easy way of doing things with out burden...thanks
Be helpful & Share your experience.
I'm always there to help anybody regarding Phplist.

Trust in God.
johnap
PL Geek
 
Posts: 64
Joined: 11:11am, Tue 09 Jan, 2007

Postby gratefuldad » 4:09am, Tue 04 Dec, 2007

Thanks for posting this. Seems to work in the footer, but not in content area.
gratefuldad
phpList newbie
 
Posts: 2
Joined: 4:03am, Tue 04 Dec, 2007

Next

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 1 guest

cron