![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 1 Pomógł: 0 Dołączył: 1.11.2005 Ostrzeżenie: (0%) ![]() ![]() |
Witam,mam problem-po kliknięciu na link pokazujący mapę strony wyskakuje mi:
Błąd bazy danych wybierania rekordów (select): SELECT nuke_cmpro.subid, nuke_cmpro.subname, nuke_cmpro.suburl, nuke_cmpro.subimage, nuke_cmpro.subactive FROM nuke_cmpro WHERE ( = 1 OR = 0) ORDER BY nuke_cmpro.suborder te kolumny znajdują się w bazie danych,to jest na serwerze ale na localchoście działa mi wszystko ok. fragment kodu php odpowiadającego za to: // used by funtion cmpro_user_showmap function cmpro_userapi_getsubpagesfromsubject($args) { extract($args); if (empty($subid)) $subid=0; if (empty($option)) $option='activeonly'; if (empty($pageid)) $pageid=0; if (empty($pagelevel)) $pagelevel=0; $ret = array(); list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); $column = &$pntable['cmpropages_column']; switch($option) { case 'activeonly': $sql = "SELECT $column[pageid], $column[pagetitle], $column[pagetitlex], $column[pageurl], $column[pageactive], $column[intro] FROM $pntable[cmpropages] WHERE $column[pageactive] = 1 AND $column[parentpageid] = $pageid AND $column[subid]=$subid ORDER BY $column[pageorder]"; break; case 'all': $sql = "SELECT $column[pageid], $column[pagetitle], $column[pagetitlex], $column[pageurl], $column[pageactive], $column[intro] FROM $pntable[cmpropages] WHERE $column[parentpageid] = $pageid AND $column[subid]=$subid ORDER BY $column[pageorder]"; break; } $result = $dbconn->Execute($sql); if ($dbconn->ErrorNo() != 0) { $output->Text(_SUB_TELLADMIN . _DBSELECTERROR . ": " . $sql); return $output->GetOutput(); } if (!$result->EOF){ while(list($pageid, $pagetitle, $pagetitlex, $pageurl, $pageactive, $intro) = $result->fields){ if (pnModAPIFunc('CMpro', 'user','auth', array('perm'=>ACCESS_READ, 'mode'=>'limitedpage', 'pageid'=>$pageid)) ) { $ret[$pageid] = array('pageid' => $pageid, 'pagetitle' => $pagetitle, 'pagetitlex' => $pagetitlex, 'pageurl' => $pageurl, 'pagelevel' => $pagelevel, 'pageactive' => $pageactive, 'intro' => $intro); $ret = $ret + pnModAPIFunc('CMpro','user','getsubpagesfromsubject', array('subid'=>$subid,'option'=>$option, 'pageid'=>$pageid, 'pagelevel'=> $pagelevel+1)); } $result->MoveNext(); } } $result->Close(); return $ret; } // write list of subpages - CybLeNoir 15/03/2003 function cmpro_userapi_simplesubpagesmenu($args) { $ThemeSel = pnUserGetTheme(); extract($args); if (!isset($table)) $table =0; if ($table ==1) { $prefix = '<tr><td>'; $middlefix = '</td><td>'; $subfix = '</td></tr>'; } else { $prefix = ''; $middlefix = ''; $subfix = '<br />'; } // verifies if there is a custom image in the current theme; if not it uses defaults if(file_exists('themes/'.$ThemeSel.'/images/arrow.gif')) $filearrow = 'themes/'.$ThemeSel.'/images/arrow.gif'; else $filearrow = 'modules/CMpro/pnimages/arrow.gif'; // end verifying foreach ($cmpropages as $pagefields) { if ($table ==1 && pnModAPIFunc('CMpro','user','auth', array('perm'=>ACCESS_ADMIN,'subid'=>$subid,'pageid'=>$pagefields[pageid]))) { $editicons = $middlefix; $editicons.= '<a class="pn-normal" href="'.htmlentities(pnModURL('CMpro','admin','pageedit', array('pageid'=>$pagefields[pageid],'from'=>'map','isintro'=>$pagefields[intro]))).'"><img src="modules/CMpro/pnimages/edit.gif" border="0" alt="'._SUB_EDIT.'" /></a>'; $editicons.= ' <a class="pn-normal" href="'.htmlentities(pnModURL('CMpro','admin','pagedelete', array('pageid'=>$pagefields[pageid],'from'=>'map','isintro'=>$pagefields[intro]))).'"><img src="modules/CMpro/pnimages/delete.gif" border="0" alt="'._SUB_DELETE.'" /></a>'; if(pnModAPIFunc('CMpro','user','auth', array('perm'=>ACCESS_ADMIN))) $editicons.= ' <a class="pn-normal" href="'.htmlentities(pnModURL('CMpro','admin','pagemove', array('pageid'=>$pagefields[pageid],'from'=>'map','isintro'=>$pagefields[intro]))).'"><img src="modules/CMpro/pnimages/move.gif" border="0" alt="'._SUB_MOVE.'" /></a>'; $editicons.= ' <a class="pn-normal" href="'.htmlentities(pnModURL('CMpro','admin','pagesadmin', array('parentpageid'=>$pagefields[pageid],'subid'=>$subid, 'from'=>'map'))).'"><img src="modules/CMpro/pnimages/pages.gif" border="0" alt="'._SUB_PAGES.'" /></a>'; } else $editicons = $middlefix. ' '; if ($pagefields[pageactive] == 0) $inactive = '<span class="pn-normal">'._SUB_INACTIVEPAGE.'</span>'; else $inactive = ''; if ($pagefields[intro]) $intropage = '<span class="pn-normal">'._SUB_GENERALINTROPAGE.'</span>'; else $intropage = ''; $level = str_repeat(' ', $pagefields[pagelevel]); if ($pagefields[pagetitlex]) $pagetitle = $pagefields[pagetitlex].''; else $pagetitle = $pagefields[pagetitle]; $level = $prefix. $level . ' <img src="'.$filearrow.'" vspace="3" alt="" /> '; $ptitle = $pagetitle; if(strlen($ptitle) > (70 - $pagefields[pagelevel] * 5)) // taglia la riga se troppo lunga $ptitle = substr(strip_tags($ptitle),0,(70 - $pagefields[pagelevel] * 5))."…"; if ($pagefields[pageurl]) $list .= $level . '<a href="'.$pagefields[pageurl].'" title="'.$ptitle.'">' . $ptitle . '</a> '. $inactive . ' ' . $intropage . $pagetitlex .$editicons . $subfix; else if ($pagefields[pageid] != $pagehilite) $list .= $level . '<a href="'.htmlentities(pnModURL('CMpro','user','viewpage', array('pageid'=>$pagefields[pageid]))).'" title="'.$pagefields[pagetitle].'">' . $ptitle . '</a> ' . $inactive . ' ' . $intropage . $pagetitlex . $editicons . $subfix; else $list .= $level . '<a name="here" href="'.htmlentities(pnModURL('CMpro','user','viewpage', array('pageid'=>$pagefields[pageid]))).'" title="'.$pagefields[pagetitle].'"><strong>' . $ptitle . '</strong> </a><strong>'._SUB_YOUAREHERE.'</strong> '. $inactive . ' ' . $intropage . $pagetitlex . $editicons . $subfix; } return $list; } // formats the title according to the style chosen in module configuration - CybLeNoir 15/12/2004 function cmpro_userapi_formattitle($args) { extract($args); if ($presentationmode == 1) $styletitle = pnModGetVar('CMpro','nstyletitle'); else $styletitle = pnModGetVar('CMpro','pstyletitle'); if (!isset($title)) $title = ' '; if (!isset($level)) $level = 1; $titlestyle=pnModGetVar('CMpro','titlestyle'); if ($titlestyle == 0) if ($level == 1) return '<div class="'.$styletitle.'">'.$title.'</div>'; else return '<div class="pn-normal" style="font-weight: bold;">'.$title.'</div>'; else if ($level == 1) return '<h1>'.$title.'</h1>'; else return '<h2>'.$title.'</h2>'; } // checks if a given page has children page or not function cmpro_userapi_numberofchildren($args) { extract($args); list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); $column = &$pntable['cmpropages_column']; $sql = "SELECT COUNT(*) FROM $pntable[cmpropages] WHERE $column[parentpageid]= $pageid"; $result = $dbconn->Execute($sql); if ($dbconn->ErrorNo() != 0) { $output->Text(_SUB_TELLADMIN . _DBSELECTERROR . ': ' . $sql); return $output->GetOutput(); } list($pagesattached) = $result->fields; $result->Close(); return $pagesattached; } przyznaję że nie jestem biegły w php,może mi ktoś pomóc zlokalizować błąd? |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 05:58 |