NIE AKTUALNE !
Wlasnie robje wersje 3.0 na zupelnie innych zasadach, mysle ze sie bardzo pozytywnie zdziwicie...
<?php { die("<font size="2" face="Arial" ><b><center>Security Error 0x005: You cannot access this file directly!</center></b></font>"); } ?>
<?php function UserExist($user_id) { $count = core::sqlNumRows( core::sqlQuery("SELECT user_name FROM ".$config["DataPrefix"]."cpmx_users WHERE user_id = '$user_id'")); if($count > 0) { return true; } else { return false; } } /****************************************************************************/ function GetUsersCount() { $sql = "SELECT * FROM ".$config['DataPrefix']."cpmx_users"; $result = core::sqlQuery($sql); $row = core::sqlFetchRow($result); $r_count = core::sqlNumRows($result); return $r_count; } ?>
<?php ///////////////////////////////////////////////////////////////////////////////// // CrystalPage MX // // Version 1.0.0 Beta (20 April 2004) // // (c) Copyright 2004 by Karim 'PsychO' Agha. All rights reserved. // ///////////////////////////////////////////////////////////////////////////////// // This script is part of the CrystalPage MX project. This project is // // free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // The GNU General Public License can be found at // // <a href="http://www.gnu.org/copyleft/gpl.html" target="_blank">http://www.gnu.org/copyleft/gpl.html</a>. // // A copy is found in the textfile GPL.txt and important notices to the // // license // // from the author is found in LICENSE.txt distributed with these scripts. // // // // // // This script is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // This copyright notice MUST APPEAR in all copies of the script! // ///////////////////////////////////////////////////////////////////////////////// // Script Discription (class.pices.php) // ///////////////////////////////////////////////////////////////////////////////// // This class is responsible for handling small texts inside the pages // ///////////////////////////////////////////////////////////////////////////////// class Content { /** * @return Bool * @param int $content_id * @desc This function checks if the specified content exist in the database */ function ContentExist($content_id) { $sql = "SELECT * FROM ".$config["DataPrefix"]."cpmx_content WHERE content_id='$content_id'"; $results = core::sqlQuery($sql); $doc_count = core::sqlNumRows($results); if($doc_count < 1) { return false; } else { return true; } } /** * @return string * @param int $content_id * @desc This function return the value of the content and enables the display on
the website */ function GetContent($content_id) { if(Content::ContentExist($content_id)) { $sql = "SELECT content_value FROM ".$config["DataPrefix"]."cpmx_content WHERE content_id='$content_id'"; $result = core::sqlQuery($sql); $row = core::sqlFetchRow($result); return $cnt; } //else { // return CONTENT_NOT_FOUND."$content_id"; // } } /** * @return void * @param int $content_id * @param string $new_value * @desc Using this function a user / administrator can edit and alter the content of the specific 'content' :-) */ function EditContent($content_id,$new_value) { if(Content::ContentExist($content_id)) { $sql = "UPDATE ".$config["DataPrefix"]. "cpmx_content SET content_value = '$new_value' WHERE content_id='$content_id'"; if(!$result = core::sqlQuery($sql)) { echo ERROR_EDIT_CONTENT; } } else { echo CONTENT_NOT_FOUND; } } /** * @return void * @param string $c_name * @param text $c_value * @desc It inserts a new content to the database and enables the future access t
o it */ function InsertContent($c_name,$c_value) { $sql = "INSERT INTO ".$config["DataPrefix"]. "cpmx_content (content_id,content_name,content_value) VALUES (content_id+1,'$c_name','$c_value')"; if(!$result = core::sqlQuery($sql)) { echo ERROR_INSERT_CONTENT; } } function GetContentByTag($content_tag) { $sql = "SELECT content_value FROM ".$config['DataPrefix']. "cpmx_content WHERE content_tag LIKE '$content_tag'"; $result = core::sqlQuery($sql); $row = core::sqlFetchRow($result); return $row[2]; } function Edit($content_tag) { $sql = "SELECT content_value FROM ".$config['DataPrefix']."cpmx_content WHERE content_tag = '$content_tag'"; $result = core::sqlQuery($sql); $row = core::sqlFetchRow($result); $fck_code = " <form action=contents.php?runlevel=edit_final method=POST> <textarea name="Content" style="WIDTH: 100%; HEIGHT: 200px">$cnt</textarea>"; return $final; } function GenerateTempContentFile($content_id) { $sql = "SELECT content_value FROM ".$config['DataPrefix']."cpmx_content WHERE content_id = $content_id"; $result = core::sqlQuery($sql); $row = core::sqlFetchRow($result); $file_path = core::getOption('temp_path').$file_name; return $file_path; } function ManageTableHead() { $head = '<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table1"> <tr> <td bgcolor="#E4E4E4"><b><font face="Arial" size="2">Content ID</font></b></td> <td bgcolor="#E4E4E4"><b><font face="Arial" size="2">Content Name</font></b></td> <td bgcolor="#E4E4E4"><b><font face="Arial" size="2">Content Tag</font></b></td> <td bgcolor="#E4E4E4" width="495"><b><font face="Arial" size="2">Preview</font></b></td> <td bgcolor="#E4E4E4"><b><font face="Arial" size="2">Actions</font></b></td> </tr>'; return $head; } function ManageTableRow($content_id) { $sql = "SELECT * FROM ".$config['DataPrefix']."cpmx_content WHERE content_id = $content_id"; $result = core::sqlQuery($sql); $object = core::sqlFetchObject($result); $_temp_cnt = Content::GenerateTempContentFile($content_id); $row = " <tr> <td>$object->content_id</td> <td>$object->content_name</td> <td>$cnt_tag</td> <td width=495> <p align=center> <iframe width=425 height=96 src='$_temp_cnt' border=0 frameborder=0 marginwidth=7 marginheight=7 align=left> Your browser does not support inline frames or is currently configured not to di
splay inline frames. And a content preview cannot be shown. </iframe></td> <td><a href=contents.php?runlevel=delete&id=$object->content_id>Delete</a><br><a href=contents.php?runlevel=edit&id=$object->content_id>Edit</a></td> </tr>"; return $row; } function DrawTableHeader($sort_by) { echo " <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table7"> <tr> <td bgcolor="#F0F0F0"><b><font face="Arial" size="2">Contents</font></b></td> </tr> </table> <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table1"> <tr> <td> </td> <td width="845"> <br> <font face="Arial" size="2"><b>Content Manager</b></font><br> <font face="Arial" size="1">(Click the table's header to sort the contents using different criteria)</font> <br><br> <table border="0" cellpadding="0" style="border-collapse: collapse" width=416 id="table8" height="10"> <tr> <td bgcolor="#F0F0F0" align="center" colspan="2"><b><font size="2" face="Arial">"; if ($sort_by=='id') { echo "<img border="0" src="Layout/reddown.gif" width="7" height="4">"; } echo " <a style="text-decoration: none; color: #000000" href="contents.php?runlevel=manage&sortby=id"> <span style="text-decoration: none">ID</span></a></font></b></td> <td bgcolor="#F0F0F0" align="center"><b> <font size="2" face="Arial">"; if ($sort_by=='name') { echo "<img border="0" src="Layout/reddown.gif" width="7" height="4">"; } echo " <a style="text-decoration: none; color: #000000" href="contents.php?runlevel=manage&sortby=name"> <span style="text-decoration: none">Content Name</span></a> </font></b></td> <td bgcolor="#F0F0F0" align="center"><b> <font size="2" face="Arial">"; if ($sort_by=='tag') { echo "<img border="0" src="Layout/reddown.gif" width="7" height="4">"; } echo "<a style="color: #000000; text-decoration: none" href="contents.php?runlevel=manage&sortby=tag"> <span style="text-decoration: none">Tag</span></a></font></b></td> <td bgcolor="#F0F0F0" align="center"><b><font size="2" face="Arial">Actions</font></b></td> <td bgcolor="#F0F0F0" align="center"><b> <font size="2" face="Arial">Status</font></b></td> </tr> "; } function DrawUserRow($content_id) { global $config; $sql = "SELECT * FROM ".$config['DataPrefix']."cpmx_content WHERE content_id = $content_id"; $result = core::sqlQuery($sql); $content = core::sqlFetchObject($result); $content_tag = htmlentities($content->content_tag); echo "<tr > <td width="4"></td> <td width=10 align="center"><font size="2" face="Arial">$content_id</font></td> <td> <font size="2" face="Arial"> <img border="0" src="Layout/overlay_group.gif" width="18" height="16"> $content->content_name</font></td> <td> <font size="2" face="Arial">$content_tag</font></td> <td><a href="contents.php?runlevel=delete_ask&id=$content_id"> <img border="0" src="Layout/delete_record.gif" width="12" height="12" alt="Delete Content"></a> <a href="contents.php?runlevel=edit2&id=$content_id"> <img border="0" src="Layout/options.gif" width="18" height="16" alt="Edit Content"></a>"; echo " </td> </tr>"; } function GetContentsCount() { global $config; $sql = "SELECT * FROM ".$config['DataPrefix']."cpmx_content"; $result = core::sqlQuery($sql); $row = core::sqlFetchRow($result); $r_count = core::sqlNumRows($result); return $r_count; } } ?>