Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Session Info
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 04/17/12 07:18 
I had a thread in the help forum but decided to move this over here. I am installing a new chat program and would like to integrate JR into it so that the users do not have to sign in.

I added the below test.php to the root dir:


Code
<?php
require_once('include/jamroom-include.inc.php');
$_user = sessionVerify();
$user = $_user['user_nickname'];
echo $_user['user_nickname'];
?>


When I call it from a browser I get the logged in user name. Sweet! (or so i thought)


So let's say I install the chat program to jr_url/mychat. How do I get the session data to read in this dir? I tried doing an include to the test.php but still no go.

Below is the code where I seen to add the session data which will auto login to chat.


jr_url/mychat/index.php


Code
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="900" height="550" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="allowFullScreen" value="false">
<param name="movie" value="chat.swf?username=<?PHP echo $_user['user_nickname'] ?>">
<param name="menu" value="false">
<param name="quality" value="best">
<param name="bgcolor" value="#2D2D2D">
<embed src="chat.swf?username=<?PHP echo $_user['user_nickname'] ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="900" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">
</object>


Why can't I pass the session data? What am I missing? Any ideas?

Thanks!

Back to top
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 04/17/12 07:58 

Code
require_once('include/jamroom-include.inc.php');


have you added this. if not then try adding it. make sure that u chmod to the root directory add the jamroom includer then come back to the directory u desire.

facebook connect module written by brian is a great example where this technique is implemented. make that module ur reference


_________________
Custom Jamroom Modules
Facebook App : http://www.jamroom.net/index.php?m=td_market&o=browse&item_id=254
Album Ranking : http://www.jamroom.net/index.php?m=td_market&o=browse&item_id=277
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 04/17/12 08:10 
Yeah that is in the test.php file.

Back to top
elixir



Joined: 28 Jun 2008
Posts: 599

Posted: 04/17/12 09:58 

Dazed:
Yeah that is in the test.php file.


how about in the jr_url/mychat/index.php


_________________
Custom Jamroom Modules
Facebook App : http://www.jamroom.net/index.php?m=td_market&o=browse&item_id=254
Album Ranking : http://www.jamroom.net/index.php?m=td_market&o=browse&item_id=277
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 04/17/12 10:02 
I tried two different ways to include it.

One way was a {include /path/file.php} (syntax is wrong but I am not at my desk lol)

The other was
{php}
Code
{/php}

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 04/17/12 18:26 

Dazed:
I tried two different ways to include it.

One way was a {include /path/file.php} (syntax is wrong but I am not at my desk lol)

The other was
{php}
Code
{/php}


Looks like your trying to include a .php file into a .tpl file. a better way is to create a module then a smarty function

If you need to some examples of how to do it, check out the /smarty/ folder of some modules.


Code
function smarty_function_apCustom_stuff($params, &$smarty) {
//gets all the stuff and returns it to the screen as a smarty variable.
//if you want it in a template:
htmlShowTemplate('skin', 'stuff.tpl', $data);

//or if you want it as a variable
$smarty->assign($params['assign'], $data);
}


Then in the templates:
{apCustom_stuff assign="STUFF_NAME"}

and {$STUFF_NAME} will be available after that. or
{apCustom_stuff row_template="stuff.tpl"} (if it is outputting a template)


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 04/17/12 20:25 
Thanks for the help all!

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.