Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
demeto Posted May 22, 2015 Posted May 22, 2015 I used exactly the code example given here but it returns a very generic error. "something went wrong,please try again." //2) Reading the Community Suite session /* Require the init.php file from the Community Suite root directory */ require 'init.php';// im in the exact same folder as init.php /* Initiate the session to verify who this user is */ \IPS\Session\Front::init(); // this line is causing problems it seems but puts out useless errors /* Print the user's name */ print \IPS\Member::loggedIn()->name; Is there a way to show more debugging messages or something? These messages are completely use less for debugging I'm in the exact same folder as init.php Would be very useful to know (i) how to extend the error message information, (ii) how to get this working.
不中用 Posted May 22, 2015 Posted May 22, 2015 I used exactly the code example given here but it returns a very generic error. "something went wrong,please try again." //2) Reading the Community Suite session /* Require the init.php file from the Community Suite root directory */ require 'init.php';// im in the exact same folder as init.php /* Initiate the session to verify who this user is */ \IPS\Session\Front::init(); // this line is causing problems it seems but puts out useless errors /* Print the user's name */ print \IPS\Member::loggedIn()->name; Is there a way to show more debugging messages or something? These messages are completely use less for debugging I'm in the exact same folder as init.php Would be very useful to know (i) how to extend the error message information, (ii) how to get this working. . Can you try this one ? replace path/to/your/init.php added some extra variables .. <?php require_once( 'path/to/your/init.php' ); \IPS\Session\Front::i(); $memCSRF = \IPS\Session::i()->csrfKey; $member = \IPS\Member::loggedIn(); $memName = $member->name; $memEmail = $member->email; $memID = $member->member_id; .
demeto Posted May 22, 2015 Author Posted May 22, 2015 @IN10TION, thanks that works, although it mildly surprises me the code example from the documentation is wrong $member = \IPS\Member::loggedIn(); // this is very helpful thank you var_dump($member); Do you also happen to know where I could find other functions like this for for instance Topic data?
不中用 Posted May 22, 2015 Posted May 22, 2015 @IN10TION, thanks that works, although it mildly surprises me the code example from the documentation is wrong $member = \IPS\Member::loggedIn(); // this is very helpful thank you var_dump($member); Do you also happen to know where I could find other functions like this for for instance Topic data? . It depends a bit how your templates interact with each other and where you are at to make changes .. Are you in your theme templates ? .
demeto Posted May 22, 2015 Author Posted May 22, 2015 I'm in both my theme templates as in an application that uses your code example. What I want to do is make sure that the topic someone views is actually send to the session so the external app sees it (going to fiddle a bit with ajax) In IPS3 i just did this by using something like session_start(); // in index.php ...... $_SESSION['topicid'] = isset($topic['tid']) ? $topic['tid'] : 0 ; // in the topicViewTemplate ips3 Not sure though if i can freely use sessions in ips4 as I could with ips3 or if it requires additional functions. (the native $_SESSION's array seem empty though so apparently it is not used)
不中用 Posted May 22, 2015 Posted May 22, 2015 I'm in both my theme templates as in an application that uses your code example. What I want to do is make sure that the topic someone views is actually send to the session so the external app sees it (going to fiddle a bit with ajax) In IPS3 i just did this by using something like session_start(); // in index.php ...... $_SESSION['topicid'] = isset($topic['tid']) ? $topic['tid']: 0 ; // in the topicViewTemplate ips3 Not sure though if i can freely use sessions in IPS4 as I could with ips3 . No idea for the sessions .. Topic id is like this now (if your theme passes the $topic variable to your template) .. $topic->tid .
demeto Posted May 22, 2015 Author Posted May 22, 2015 .No idea for the sessions ..Topic id is like this now (if your theme passes the $topic variable to your template) ..$topic->tid .Super thanks a lot mate! I found this one also for the forumview (multiple topics)template code: data-rowID='{$row->$idField}' // in themes / forums / topicRowThanks again for the help!!
不中用 Posted May 22, 2015 Posted May 22, 2015 Super thanks a lot mate! I found this one also for the forumview (multiple topics) template code: data-rowID='{$row->$idField}' // in themes / forums / topicRow Thanks again for the help!! . Just wanted to reply .. {{foreach $rows as $row}} is mostly used with $idField as {{$idField = $row::$databaseColumnId;}} .. Will be a bit of trial and error to puzzle it .. .
demeto Posted May 22, 2015 Author Posted May 22, 2015 . Just wanted to reply .. {{foreach $rows as $row}} is mostly used with $idField as {{$idField = $row::$databaseColumnId;}} .. Will be a bit of trial and error to puzzle it .. . Ok cool good to know, I'll fiddle around, cheers!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.