Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Get Current Survey ID?

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 8 months ago #202746 by blocka
Get Current Survey ID? was created by blocka
I need to make a small modification to the source code, and want to check for a specific survey ID. Can someone provide the code snippet to do this?

Basically, I want to check for :

IF CurrentsurveyID = 123456, then
do something
Endif

So just need to know how to get value of CurrentsurveyID
The topic has been locked.
More
3 years 8 months ago #202748 by jelo
Replied by jelo on topic Get Current Survey ID?
Isn't {SID} working, to get the surveyid?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 8 months ago #202749 by blocka
Replied by blocka on topic Get Current Survey ID?
Thanks, I mean in the PHP source code...

I came across examples like $surveyid = $oSurvey->sid; -- which makes me think that $oSurvey->sid is what I would use...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #202754 by tpartner
Replied by tpartner on topic Get Current Survey ID?
Why are you modifying the source code? Can whatever you want done be accomplished in the theme TWIG files. That would be safer.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose