<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Interfacing Advanced Poll in Mambo"]]></title>
		<link>https://proxy2.de/forum/posts/list/3.php</link>
		<description><![CDATA[Latest messages posted in the topic "Interfacing Advanced Poll in Mambo"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Interfacing Advanced Poll in Mambo</title>
				<description><![CDATA[ I've added a front end to Advanced poll, to display a list of all "active" polls.  Each poll on this list can have a "vote" or "view results" button, which depends on wheter a member has already voted or not on a given poll.  It worked fine on the old site, but I'm now trying to migrate it to the new site which is using mambo.  The first step I took was to see if I could get the poll list to display correctly using a hard coded user id.  This worked fine, and it displayed all of the active polls with the appropriate "vote" and "view results" buttons for the user (hard coded).  However, I had no success when I removed the hard coded user id, and tried to get the id for the currently logged on user, from the session array.<br /> This brings me to where I'm at now.  Instead of having the mambo menu item link directly to poll's index.php file, I had it link to a new script, prepoll.php, whose job was going to be to get the user information and make the info available to poll's index.php - In a test, I made some "play" info visible to index.php, however the displaying of the poll index didn't occur.  For the poll list to be displayed, index.php is to be executed twice.  The first time $action var is not set, and the default of the case statement (below) is called.  poll_index() is a function in index.php, and it would normally execute when the case stament's default is hit.<br /> <br /> [code]  switch &#40;$action&#41; &#123;<br />     case &quot;help&quot;;<br />       break ;<br />     case &quot;display&quot;&#58;<br />       // Display the poll - poll_process will determine member is to see the poll<br />       echo &#40;$php_poll-&gt;poll_process&#40;$poll_id,$tAccountName, $lcFirstName&#41;&#41;;<br />       break;<br />     case &quot;vote&quot;&#58;<br />       // Process members vote - member clicked &quot;vote&quot; button on poll<br />       // Submit the vote - poll_process will determine member has voted   <br />       echo &#40;$php_poll-&gt;poll_process&#40;$nPollIdent,$tAccountName, $lcFirstName&#41;&#41;;<br />       break;<br />     case &quot;results&quot;;<br />       // Display poll results - occurs when member clicks on &quot;Show Results&quot; button<br />       //  Either in the main poll index, or on the &quot;view results&quot; link on the poll<br />       echo&#40;$php_poll-&gt;view_poll_result&#40;$poll_id,0&#41;&#41; ;<br />       break ;<br />     default&#58;<br />       // Displays the poll list<br />       echo &quot;Reached default &lt;br&gt;&quot; ;<br /> <br />       poll_index&#40;&#41;;<br />       break;<br />   &#125;[/code]<br /> <br /> When I use prepoll.php I have the following line of code<br /> [code]include &#40;&quot;../../poll/index.php&quot;&#41; ;[/code]to call index.php.<br /> It goes into index.php fine, dummy/text info is passed to it from prepoll.php, and it goes into the default section of the case statement.  However, it doesn't execute poll_index(), because it never goes back into index.php.<br /> <br /> [color="red"]Is the include I have in prepoll the problem?[/color]<br /> In order to make the session array work correctly in the old site I had to make sure the session array was referenced relative to the domain by using ini_set - e.g., ini_set('session.cookie_domain','.mydomain') ;<br /> I don't have full freedom in the mambo environment, so I thought I could use mambo's get_user() function in prepoll.php and set the session array the way I need it to be set.<br /> <br /> Maybe the crux of my question is: [color="red"]How, in php, do you call script B from script A so script B runs the same way as if script B was executed directly?[/color]]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/6318/22397.php</guid>
				<link>https://proxy2.de/forum/posts/preList/6318/22397.php</link>
				<pubDate><![CDATA[Wed, 7 Mar 2007 20:48:28]]> GMT</pubDate>
				<author><![CDATA[ Michael_C]]></author>
			</item>
	</channel>
</rss>