Welcome, Guest
Username: Password: Remember me

TOPIC: Token Error Message - Adding a Phone Number

Token Error Message - Adding a Phone Number 3 years 4 months ago #52591

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
Hi.

I'm currently editing the top level index.php file around lines 2010-2015. I'm trying to edit the following code;

echo '<div id="wrapper"><p id="tokenmessage">'.$clang->gT("This is a controlled survey. You need a valid token to participate.")."<br /><br />\n"
."\t".$clang->gT("The token you have provided is either not valid, or has already been used.")."<br />\n"
."\t".sprintf($clang->gT("For further information contact %s"), $thissurvey)
." (<a href='mailto:{$thissurvey}'>"
."{$thissurvey}</a>)</p></div>\n";

I want to make it in to something a little more descriptive to the average person, who maybe does not know what a "token" is etc. I was also hoping to put in a phone number. I can't see anywhere in the admin tool that asks for a phone number when creating a new survey however there is a fax number entry? I would be willing to use this instead so long as it didn't cause problems else where. e.g a big flashing note that says YOU CAN NOW FAX THIS SURVEY TO THIS NUMBER!! haha.

Can you tell me what the array name/element would be? maybe something like $thissurvey? If you have any better ideas though I'd be happy to listen...

Oh, And I'm using v1.87+

Mike
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52597

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2442
  • Thank you received: 254
  • Karma: 94
Hi Mike, I am quite sure that you will find those texts in the translation files, which would be a lot easier to do, i think. Have a look at this! Mike save you some time.

Regarding the fax number: I have no idea.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52620

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5830
  • Thank you received: 711
  • Karma: 220
Hello,

In the template {FAX_TO} , it used in print_survey.pstpl, i'm not sure it can be used elsewhere. I think it can be great to have other survey text to put like PHONE, or HELP_TEXT.

Maybe just an HELP_TEXT more , to put everywhere we want on the template.

:)
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52628

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5275
  • Thank you received: 289
  • Karma: 246
Don't touch the core files, you will have problems when updating later. The message you mentioned can be set by editing the translation.

To add a phone number you can simply create a copy of your template and add it manually to the according screen at the template.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52635

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
Ah jeez! How am I supposed to understand this stuff? This is far too advanced for me! poEDIT?

I've tried looking through the translation documentation but I don't see how this relates to my problem?! The first line is "Wouldn't it be great to have LimeSurvey completely translated to your mother-language?". That has nothing to do with my problem. My survey is in English. It's fine. I just want MY survey tweaked slightly.

Are you trying to direct me to the Template Editor? If so, which "screen" am I supposed to edit? Becuase I've looked through them ALL now.

Mike
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52636

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2442
  • Thank you received: 254
  • Karma: 94
You can create your own "Language", call it "Mike-English" and there you can change any string of Limesurvey to the text you want. It isn't necessarily translating, more a changing of text in your case. But it works the same as described on this page.

poEdit is a tool that helps you to "translate" those strings, or better to change it. It is not that hard.

If you go into the core files and change them, this can cause trouble when upgrading to another version (or even in the current version), especially if you consider the page about translating as too advanced ;)

Thus the tip with the translation files, which is a lot easier to handle when it comes to upgrading.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Last Edit: 3 years 4 months ago by holch.
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52639

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
This is insane. New languages? template editors? Can't I just put an includes file in the index.php? I'll create a back up of the index in case I upgrade... I totally promise!

Mike
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52646

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2442
  • Thank you received: 254
  • Karma: 94
Well, Mike, it is totally up to you, but I don't see a problem in copying the current version of English, give it a different name, change the text passages you want to change and activate it as language for your survey. You don't need the template editor for that. You probably don't even need poedit, but it makes life easier when working with the language files of limesurvey.

You don't even need to create a new language, you could even change it in the default one, but then you can loose the changes in case the language file is upgraded in a newer release of LS.

I'd consider this procedure easier than hard coding in the index file. But this is of course up to you. You need to be comfortable with it. We can just give you hints.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:Token Error Message - Adding a Phone Number 3 years 4 months ago #52839

  • Mike1985
  • Mike1985's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 49
  • Karma: 0
Ok. Thanks a lot. I had trouble figuring it out straight away but now I get it! Ha.

A further problem has developed though. It turns out my language file (English) isn't actually being used. It uses the default. I changed it to Italian just to see if that would work and it DID change everything to Italian and then (to my horror) I couldn't change it back to English.

Eventually, when LOGGING IN, I saw that there is an option to change the language. I selected English and it went back to the default. Something MAD is going on here.

It says it's using the English language file in the table (settings_global -> defaultlang -> en) so I don't know what's happening!

I think I might just upgrade to 1.9...
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.120 seconds
Donation Image