<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged variable</title>
<link>https://www.question2answer.org/qa/tag/variable</link>
<description>Powered by Question2Answer</description>
<item>
<title>Save a incoming url parameter as a session variable</title>
<link>https://www.question2answer.org/qa/85394/save-a-incoming-url-parameter-as-a-session-variable</link>
<description>

&lt;p class=&quot;p1&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(83, 101, 121);&quot;&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;I want a user to be able to filter out questions written in a specific language, and do it using an url-parameter when entering the site.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;p1&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(83, 101, 121);&quot;&gt;&lt;/p&gt;

&lt;p class=&quot;p1&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(83, 101, 121);&quot;&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;I am in qa-base.php accessing the url-parameter, but I can't seem to keep the variable value when I switch to some of the other pages. Trying with using session variable, but cant get it to work.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;p1&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(83, 101, 121);&quot;&gt;&lt;/p&gt;

&lt;p class=&quot;p1&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(83, 101, 121);&quot;&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; $thelang=qa_get(&lt;/span&gt;&lt;span style=&quot;color:#1c00cf&quot; class=&quot;s2&quot;&gt;'thelang'&lt;/span&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;); &lt;/span&gt;&lt;em&gt;// get from URL parameter if possible&lt;/em&gt;&lt;/p&gt;

&lt;p class=&quot;p2&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color:#9b2393&quot; class=&quot;s3&quot;&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/span&gt;(&lt;span style=&quot;color:#9b2393&quot; class=&quot;s3&quot;&gt;&lt;strong&gt;isset&lt;/strong&gt;&lt;/span&gt;($thelang)){&lt;/p&gt;

&lt;p class=&quot;p2&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;$_SESSION[&lt;span style=&quot;color:#1c00cf&quot; class=&quot;s2&quot;&gt;'thelang'&lt;/span&gt;] = $thelang;&lt;/p&gt;

&lt;p class=&quot;p3&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22);&quot;&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color:#9b2393&quot; class=&quot;s3&quot;&gt;&lt;strong&gt;echo&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt; &lt;/span&gt;&quot;&amp;lt;br&amp;gt;Got GET Parameter!&amp;lt;br&amp;gt;&quot;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;p1&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(83, 101, 121);&quot;&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;} &lt;/span&gt;&lt;span style=&quot;color:#9b2393&quot; class=&quot;s3&quot;&gt;&lt;strong&gt;else&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot; class=&quot;s1&quot;&gt; { &lt;/span&gt;&lt;em&gt;// get from SESSION variable&lt;/em&gt;&lt;/p&gt;

&lt;p class=&quot;p2&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 0, 0);&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;$thelang = $_SESSION[&lt;span style=&quot;color:#1c00cf&quot; class=&quot;s2&quot;&gt;'thelang'&lt;/span&gt;]; // this part doesn't seem to work.&lt;/p&gt;

&lt;p class=&quot;p3&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22);&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;/p&gt;

&lt;p class=&quot;p3&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22);&quot;&gt;&lt;/p&gt;

&lt;p class=&quot;p3&quot; style=&quot;margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22);&quot;&gt;Thanks for any help! Maybe there is better ways to save the variable between pages.&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/85394/save-a-incoming-url-parameter-as-a-session-variable</guid>
<pubDate>Sun, 28 Jun 2020 20:44:16 +0000</pubDate>
</item>
<item>
<title>Why is $userid not globally set?</title>
<link>https://www.question2answer.org/qa/51377/why-is-%24userid-not-globally-set</link>
<description>I am seeing myself using&lt;br /&gt;
&lt;br /&gt;
$userid = qa_get_logged_in_userid();&lt;br /&gt;
&lt;br /&gt;
over and over again.&lt;br /&gt;
&lt;br /&gt;
It would be easier to have this data &amp;quot;globally&amp;quot; accessible as $userid.&lt;br /&gt;
&lt;br /&gt;
Is that possible?</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/51377/why-is-%24userid-not-globally-set</guid>
<pubDate>Sat, 16 Apr 2016 06:57:40 +0000</pubDate>
</item>
<item>
<title>How can I push the Q2A user role into a javascript variable?</title>
<link>https://www.question2answer.org/qa/49873/how-can-i-push-the-q2a-user-role-into-a-javascript-variable</link>
<description>

&lt;p&gt;I need to create some custom&amp;nbsp;javascript that uses the user role.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;I can easily get the user ID from mark-up..&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var q2aUserID&amp;nbsp;= $('.qa-user-link').text();&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;..but is there a&amp;nbsp;way to push the &lt;span style=&quot;text-decoration: underline;&quot;&gt;user role&lt;/span&gt; (expert, editor, moderator, etc)&amp;nbsp;into a JS variable?&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Many thanks&amp;nbsp;&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/49873/how-can-i-push-the-q2a-user-role-into-a-javascript-variable</guid>
<pubDate>Fri, 15 Jan 2016 22:32:13 +0000</pubDate>
</item>
<item>
<title>How to put variable or function inside $this-&gt;output or html??</title>
<link>https://www.question2answer.org/qa/27445/how-to-put-variable-or-function-inside-%24this-output-or-html</link>
<description>

&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;div&gt;
	

&lt;div&gt;
		I am thinking this is probably a syntax error?. &amp;nbsp;Basically all I want to do is put the search bar inside another div that is inside the login-bar div.&lt;/div&gt;
	

&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	

&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	

&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	

&lt;div&gt;
		This is shortened version of the code&lt;/div&gt;
	

&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	

&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	

&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	

&lt;div&gt;
		

&lt;blockquote&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;function body_header()&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;$this-&amp;gt;output('&amp;lt;div id=&quot;qa-login-bar&quot;&amp;gt;&amp;lt;div id=&quot;qa-login-group&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;output ('&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this-&amp;gt;search();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ');&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp;$this-&amp;gt;output('&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;');&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
			

&lt;div&gt;
				&lt;span style=&quot;color:#008080;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;/blockquote&gt;
	&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;p&gt;
	When I do this, I get a blank page. &amp;nbsp;Any suggestions of what I'm doing wrong? t/y&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/27445/how-to-put-variable-or-function-inside-%24this-output-or-html</guid>
<pubDate>Tue, 10 Sep 2013 05:25:07 +0000</pubDate>
</item>
<item>
<title>Advanced Theme: How to set variable in one function and use it in another?</title>
<link>https://www.question2answer.org/qa/22532/advanced-theme-how-set-variable-one-function-and-use-another</link>
<description>I am using an advanced theme to override two functions:&lt;br /&gt;
&lt;br /&gt;
1. function main()&lt;br /&gt;
&lt;br /&gt;
2. function q_view($q_view)&lt;br /&gt;
&lt;br /&gt;
In main() I am also checking some user information, like is logged in and more! Then I set a boolean variable in main().&lt;br /&gt;
&lt;br /&gt;
This boolean variable I need to access now from within q_view(), without doing all the queries again that I did in main().&lt;br /&gt;
&lt;br /&gt;
How would you do that?&lt;br /&gt;
&lt;br /&gt;
Thanks and have a good weekend,&lt;br /&gt;
Kai</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/22532/advanced-theme-how-set-variable-one-function-and-use-another</guid>
<pubDate>Fri, 22 Mar 2013 05:46:21 +0000</pubDate>
</item>
<item>
<title>Undefined variable: qa-plugin/countryflags-plugin/qa-plugin.php on line 297</title>
<link>https://www.question2answer.org/qa/14474/undefined-variable-plugin-countryflags-plugin-plugin-line</link>
<description>

&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;div&gt;
	The folowing error is shown in some users just registered, some of them doesn't have their profile with information.&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	Notice: Undefined variable: name in /respuestas/qa-plugin/countryflags-plugin/qa-plugin.php on line 297&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;</description>
<category>Plugins</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/14474/undefined-variable-plugin-countryflags-plugin-plugin-line</guid>
<pubDate>Tue, 24 Apr 2012 06:50:40 +0000</pubDate>
</item>
<item>
<title>Internal Notification solution =mention-notifier+ Insert predetermined variable in the responses textbox like @username</title>
<link>https://www.question2answer.org/qa/8213/internal-notification-predetermined-responses-%40username</link>
<description>hello!&lt;br /&gt;
&lt;br /&gt;
I want to do that when you click to answer or comment automatically inserted into the text box the user name who wrote the questions or answers, like this: &amp;quot;@username&amp;quot;&lt;br /&gt;
&lt;br /&gt;
for use with mention-notifier plugin, get a automaticall mention like a internal notification system&lt;br /&gt;
&lt;br /&gt;
any idea?</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/8213/internal-notification-predetermined-responses-%40username</guid>
<pubDate>Sat, 13 Aug 2011 21:15:47 +0000</pubDate>
</item>
<item>
<title>Can I add a variable to the navigation tabs?</title>
<link>https://www.question2answer.org/qa/1071/can-i-add-a-variable-to-the-navigation-tabs</link>
<description>This might be a bit odd. Basically, I set up a chat room and have a tab that links to the chat in the nav in a custom theme. &lt;br /&gt;
&lt;br /&gt;
I want to list how many people are in the chat in the tab. So the tab would say something like &amp;quot;Chat $Num_Active_Users&amp;quot; Where $Num_Active_Users is the number of people that are chatting. And don't worry, I already know how to get the variable. I'm just stumped on how to insert it into the tab.</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/1071/can-i-add-a-variable-to-the-navigation-tabs</guid>
<pubDate>Sun, 23 May 2010 03:22:36 +0000</pubDate>
</item>
</channel>
</rss>