okay, i'm in the beginning of this module. It writes to the DB with the correct info, but wont show. "Sorry. Item load failed" I've checked the script over and over but cant find whats wrong... So maybe a second opinion could work?
Pntables;
$pntable['writer_characters_column'] = array('characterid' => $Characters . '.characterid',
'categoryid' => $Characters . '.categoryid',
'charname' => $Characters . '.charname');
From pnadmin.php
function Example_admin_new()
{
if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_ADD)) {
return pnVarPrepHTMLDisplay(_MODULENOAUTH);
}
$pnRender =& new pnRender('Example');
$pnRender->caching = false;
return $pnRender->fetch('example_admin_new.htm');
}
function Example_admin_create($args)
{
list($categoryid,
$charname) = pnVarCleanFromInput('categoryid',
'charname');
extract($args);
if (!pnSecConfirmAuthKey()) {
pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_BADAUTHKEY));
pnRedirect(pnModURL('Example', 'admin', 'view'));
return true;
}
if (!pnModAPILoad('Example', 'admin')) {
pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_LOADFAILED));
pnRedirect(pnModURL('Example', 'admin', 'view'));
return true;
}
$characterid = pnModAPIFunc('Example',
'admin',
'create',
array('categoryid' => $categoryid,
'charname' => $charname));
if ($characterid) {
// Success
pnSessionSetVar('statusmsg', pnVarPrepHTMLDisplay(_EXAMPLECREATED));
}
pnRedirect(pnModURL('Example', 'admin', 'view'));
// Return
return true;
}
_______________________________________
function Example_admin_view()
{
$startnum = pnVarCleanFromInput('startnum');
if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_EDIT)) {
return pnVarPrepHTMLDisplay(_MODULENOAUTH);
}
if (!pnModAPILoad('Example', 'user')) {
return pnVarPrepHTMLDisplay(_LOADFAILED);
}
$pnRender =& new pnRender('Example');
$pnRender->caching = false;
$itemsperpage = pnModGetVar('Example', 'itemsperpage');
$items = pnModAPIFunc('Example',
'user',
'getall',
array('startnum' => $startnum,
'numitems' => $itemsperpage));
foreach ($items as $key => $item) {
if (pnSecAuthAction(0, 'Example::', "$item[categoryid]::$item[characterid]", ACCESS_READ)) {
$options = array();
if (pnSecAuthAction(0, 'Example::', "$item[categoryid]::$item[characterid]", ACCESS_EDIT)) {
$options[] = array('URL' => pnModURL('Example', 'admin', 'modify', array('characterid' => $item['characterid'])),
'title' => _EDIT);
if (pnSecAuthAction(0, 'Example::', "$item[categoryid]::$item[characterid]", ACCESS_DELETE)) {
$options[] = array('URL' => pnModURL('Example', 'admin', 'delete', array('characterid' => $item['characterid'])),
'title' => _DELETE);
}
}
$items[$key]['options'] = $options;
}
}
$pnRender->assign('exampleitems', $items);
$pnRender->assign('pager', array('numitems' => pnModAPIFunc('Example',
'user',
'countitems'),
'itemsperpage' => $itemsperpage));
// Return the output that has been generated by this function
return $pnRender->fetch('example_admin_view.htm');
}
________________________________________
function Example_admin_new()
{
if (!pnSecAuthAction(0, 'Example::', '::', ACCESS_ADD)) {
return pnVarPrepHTMLDisplay(_MODULENOAUTH);
}
$pnRender =& new pnRender('Example');
// We need the pnsecgenauthkey plugin, so we must not cache here.
$pnRender->caching = false;
// Return the output that has been generated by this function
return $pnRender->fetch('example_admin_new.htm');
}
From template; admin view
From template; Admin new
HEEEEEEEEEELP :)
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Won't load from Db
-
- Rank: Registered User
- Registered: Sep 12, 2002
- Last visit: Mar 23, 2009
- Posts: 47
-
- Rank: Registered User
- Registered: Sep 12, 2002
- Last visit: Mar 23, 2009
- Posts: 47
-
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
echo out the SQL - if you paste it into phpMyAdmin, does it work?
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
- Rank: Registered User
- Registered: Sep 12, 2002
- Last visit: Mar 23, 2009
- Posts: 47
oooopsies... I had just completely forgotten the userapi... *blushing* ...
- Moderated by:
- Support
