"Personal Options", 'url' => "$PHP_SELF?mod=options&action=personal", 'access' => "4", ), array( 'name' => "Block IP's from posting comments", 'url' => "$PHP_SELF?mod=ipban", 'access' => "1", ), array( 'name' => "System Configurations", 'url' => "$PHP_SELF?mod=options&action=syscon&rand=".time(), 'access' => "1", ), array( 'name' => "Edit Templates", 'url' => "$PHP_SELF?mod=options&action=templates", 'access' => "1", ), array( 'name' => "Add/Edit Users", 'url' => "$PHP_SELF?mod=editusers&action=list", 'access' => "1", ), array( 'name' => "Archives Manager", 'url' => "$PHP_SELF?mod=tools&action=archive", 'access' => "1", ), array( 'name' => "Manage Uploaded Images", 'url' => "$PHP_SELF?mod=images", 'access' => "1", ), array( 'name' => "Backup Tool", 'url' => "$PHP_SELF?mod=tools&action=backup", 'access' => "1", ), array( 'name' => "Edit Categories", 'url' => "$PHP_SELF?mod=categories", 'access' => "1", ), ); //------------------------------------------------ // Cut the options for wich we don't have access //------------------------------------------------ $count_options = count($options); for($i=0; $i<$count_options; $i++){ if($member_db[1] > $options[$i]['access']){ unset($options[$i]); } } echo''; $i = 0; foreach($options as $option){ if($i%2 == 0){ echo"\n\n\n"; } else{ echo"\n\n"; } $i++; } echo'
   ".$option['name']."".$option['name']."
'; echofooter(); } // ******************************************************************************** // Show Personal Options // ******************************************************************************** elseif($action == "personal") { echoheader("user","Personal Options"); $registrationdate = date("D, d F Y",$member_db[0]); //registration date if($member_db[7] == 1){ $ifchecked = "Checked"; } //if user wants to hide his e-mail foreach($member_db as $key=>$value){ $member_db[$key] = stripslashes(preg_replace(array("'\"'", "'\''"), array(""", "'"),$member_db[$key])); } echo" "; if($member_db[1] != 4){echo""; }else{ $bg = "bgcolor=#F7F6F4"; } echo""; } echo"
  Username $member_db[2]
  New Password    Only if you want to change the current
  Nickname
  Email     Hide my e-mail from visitors
  Default Avatar URL     will appear on 'Add News' page
  Access Level "; if ($member_db[1] == 4){ echo "commenter"; } elseif ($member_db[1] == 3){ echo "journalist"; } elseif ($member_db[1] == 2){ echo "editor"; } elseif ($member_db[1] == 1){ echo "administrator"; } if($member_db[1] != 4){ echo"
  written news $member_db[6]
  registration date $registrationdate

"; echofooter(); } // ******************************************************************************** // Save Personal Options // ******************************************************************************** elseif($action == "dosavepersonal") { $editnickname = replace_comment("add",$editnickname); $editmail = replace_comment("add",$editmail); $edithidemail = replace_comment("add",$edithidemail); $change_avatar = replace_comment("add",$change_avatar); if($edithidemail){ $edithidemail = 1;}else{ $edithidemail = 0; } $avatars = preg_replace(array("'\|'","'\n'","' '"), array("","","_"), $avatars); $old_user_db = file("./data/users.db.php"); $new_user_db = fopen("./data/users.db.php", w); $personal_success = FALSE; foreach($old_user_db as $old_user_db_line){ $old_user_db_arr = explode("|", $old_user_db_line); if(strtolower($username) != strtolower($old_user_db_arr[2])){ fwrite($new_user_db,"$old_user_db_line"); } else{ if($editpassword != ""){ $old_user_db_arr[3] = md5($editpassword); if($config_use_cookies == TRUE){ setcookie("md5_password", $old_user_db_arr[3]); } $_SESSION['md5_password'] = $old_user_db_arr[3]; } fwrite($new_user_db,"$old_user_db_arr[0]|$old_user_db_arr[1]|$old_user_db_arr[2]|$old_user_db_arr[3]|$editnickname|$editmail|$old_user_db_arr[6]|$edithidemail|$change_avatar|$old_user_db_arr[9]||\n"); $personal_success = TRUE; } } fclose($new_user_db); if($personal_success){ msg("info", "Changes Saved", "Your personal information was saved.", "$PHP_SELF?mod=options&action=personal"); } else{ msg("error", "Error !!!", "Error while listing users, $username not found", "$PHP_SELF?mod=options&action=personal"); } } // ******************************************************************************** // Edit Templates // ******************************************************************************** elseif($action == "templates") { if($member_db[1] != 1){ msg("error", "Access Denied", "You don't have permissions for this type of action"); } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Detect all template packs we have ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ $templates_list = array(); if(!$handle = opendir("./data")){ die("
Can not open directory $cutepath/data "); } while (false !== ($file = readdir($handle))){ if(eregi(".tpl", $file)){ $file_arr = explode(".", $file); $templates_list[]= $file_arr[0]; } } closedir($handle); /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we want to create new template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if($subaction == "new"){ echoheader("options", "New Template"); echo"
Create new template based on: with name  
'; echofooter(); exit; } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Do Create the new template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if($subaction == "donew"){ if(!eregi("^[a-z0-9_-]+$", $template_name)){ msg("error", "Error", "The name of the template must be only with letters and numbers", "$PHP_SELF?mod=options&subaction=new&action=templates"); } if(file_exists("./data/${template_name}.tpl")){ msg("error", "Error", "Template with this name already exists", "$PHP_SELF?mod=options&subaction=new&action=templates"); } if($base_template != ""){ $base_file = "./data/${base_template}.tpl"; } else{ $base_file = "./data/Default.tpl"; } if (!copy($base_file, "./data/${template_name}.tpl")) { msg("error", "Error", "Can not copy file $base_file to ./data/ folder with name ${template_name}.tpl"); } @chmod("./data/${template_name}.tpl", 0777); msg("info", "Template Created", "A new template was created with name ${template_name}
", "$PHP_SELF?mod=options&action=templates"); } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Deleting template, preparation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if($subaction == "delete"){ if(strtolower($do_template) == "default"){ msg("Error", "Error !!!", "You can not delete the default template", "$PHP_SELF?mod=options&action=templates"); } $msg = "
Are you sure you want to delete the template $do_template ?

 
"; msg("info", "Deleting Template", $msg); } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DO Deleting template ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if($subaction == "dodelete"){ if(strtolower($do_template) == "default"){ msg("Error", "Error !!!", "You can not delete the default template", "$PHP_SELF?mod=options&action=templates"); } $unlink = unlink("./data/${do_template}.tpl"); if(!$unlink){ msg("error", "Error", "Can not delete file ./data/${do_template}.tpl
maybe the is no permission from the server"); } else{ msg("info", "Template Deleted", "The template ${do_template} was deleted.", "$PHP_SELF?mod=options&action=templates"); } } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Show The Template Manager ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if($do_template == '' or !$do_template){ $do_template = 'Default'; $show_delete_link = ''; }elseif(strtolower($do_template) != 'default'){ $show_delete_link = "[delete this template]"; } require("./data/${do_template}.tpl"); if(eregi("opera", $HTTP_USER_AGENT)){ $tr_hidden = ""; } else{ $tr_hidden = " style='display:none'"; } $templates_names = array("template_active", "template_comment", "template_form", "template_full", "template_prev_next", "template_comments_prev_next"); foreach($templates_names as $template) { $$template = preg_replace("//",">",$$template); } echoheader("options","Templates"); echo'
Manage Templates
 Editing Template '.$do_template.'
 Switch to Template
 [create new template]  '.$show_delete_link.'
 Understanding Templates

Edit Template Parts
Active News
{title}
{avatar}
{short-story}
{full-story}
{author}
{author-name}
[mail]
and [/mail]
{date}
[link]
and [/link]
[full-link]
and [/full-link]
[com-link]
and [/com-link]
{comments-num}
{category}
{category-icon}
- Title of the article
- Show Avatar image (if any)
- Short story of news item
- The full story
- Author of the article, with link to his email (if any)
- The name of the author, without email
- Will generate a link to the author mail (if any) eg. [mail]Email[/mail]
- Date when the story is written
- Will generate a permanent link to the full story
- Link to the full story of article, only if there is full story
- Generate link to the comments of article
- This will display the number of comments posted for article
- Name of the category where article is posted (if any)
- Shows the category icon (if any)

 
Full Story
{title}
{avatar}
{full-story}
{short-story}

{author}
{author-name}
[mail]
and [/mail]
{date}
{comments-num}
{category}
{category-icon}
- Title of the article
- Show Avatar image (if any)
- The full story
- Short story of news item
- Author of the article, with link to his email (if any)
- The name of the author, without email
- Will generate a link to the author mail (if any) eg. [mail]Email[/mail]
- Date when the story is written
- This will display the number of comments posted for article
- Name of the category where article is posted (if any)
- Shows the category icon (if any)

 
Comment
{author}
{mail}
{date}
{comment}
- Name of the comment poster
- E-mail of the poster
- Date when the comment was posted
- The Comment

 
Add comment form
Please do not edit this unless you have basic HTML knowledge !!!

 
News Pagination
[prev-link] and [/prev-link]
[next-link]
and [/next-link]
{pages}
- Will generate a link to preveous page (if there is)
- Will generate a link to next page (if there is)
- Shows linked numbers of the pages; example: 1 2 3 4
Comments Pagination
[prev-link] and [/prev-link]
[next-link]
and [/next-link]
{pages}
- Will generate a link to preveous page (if there is)
- Will generate a link to next page (if there is)
- Shows linked numbers of the pages; example: 1 2 3 4

'; echofooter(); } // ******************************************************************************** // Do Save Changes to Templates // ******************************************************************************** elseif($action == "dosavetemplates") { if($member_db[1] != 1){ msg("error", "Access Denied", "You don't have permissions for this type of action"); } $templates_names = array("edit_active", "edit_comment", "edit_form", "edit_full", "edit_prev_next", "edit_comments_prev_next"); foreach($templates_names as $template) { $$template = stripslashes($$template); } if($do_template == "" or !$do_template){ $do_template = "Default"; } $template_file = "./data/${do_template}.tpl"; $handle = fopen("$template_file","w"); fwrite($handle, "\n"); msg("info","Changes Saved","The changes to template $do_template were successfully saved.","$PHP_SELF?mod=options&action=templates&do_template=$do_template"); } // ******************************************************************************** // System Configuration // ******************************************************************************** elseif($action == "syscon") { echoheader("options", "System Configuration"); function showRow($title="", $description="", $field="") { global $i; if( $i%2 == 0 and $title != ""){ $bg = "bgcolor=#F7F6F4"; } echo"  $title $field
    $description "; $bg = ""; $i++; } function makeDropDown($options, $name, $selected) { $output = ""); showRow("CuteNews Skin", "you can download more from our website", makeDropDown($sys_con_skins_arr, "save_con[skin]", "$config_skin")); showRow("Auto Wrap Comments", "any word that is longer than this will be wrapped", ""); showRow("Comments Flood Protection", "in seconds; 0 = no protection", ""); showRow("Smilies", "Separate them with commas (,)", ""); showRow("Time Adjustment", "in minutes; eg. : 180=+3 hours; -120=-2 hours", ""); showRow("Use Avatars", "if not, the avatar URL field wont be shown", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[use_avatar]", "$config_use_avatar")); showRow("Reverse Comments", "if yes, newest comments will be shown on the top", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[reverse_comments]", "$config_reverse_comments")); showRow("Reverse News", "if yes, older news will be shown on the top", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[reverse_active]", "$config_reverse_active")); // Full Story Configs showRow("Show Comments When Showing Full Story", "if yes, comments will be shown under the story", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[show_comments_with_full]", "$config_show_comments_with_full")); showRow("Time Format For News", "view help for time formatting here", ""); showRow("Show Full Story In PopUp", "full Story will be opened in PopUp window", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[full_popup]", "$config_full_popup")); showRow("Settings for Full Story PopUp", "only if 'Show Full Story In PopUp' is enabled", ""); // COMMENTS Configs showRow("Max. Length of Comments in Characters", "enter 0 to disable checking", ""); showRow("Comments Per Page (Pagination)", "enter 0 or leave empty to disable pagination", ""); showRow("Only Registered Users Can Post Comments", "if yes, only registered users can post comments", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[only_registered_comment]", "$config_only_registered_comment")); showRow("Allow Mail Field to Act and as URL Field", "visitors will be able to put their site URL insted of mail", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[allow_url_instead_mail]", "$config_allow_url_instead_mail")); showRow("Show Full Story When Showing Comments", "if yes, comments will be shown under the story", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[show_full_with_comments]", "$config_show_full_with_comments")); showRow("Time Format For Comments", "view help for time formatting here", ""); showRow("Show Comments In PopUp", "comments will be opened in PopUp window", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[comments_popup]", "$config_comments_popup")); showRow("Settings for Comments PopUp", "only if 'Show Comments In PopUp' is enabled", ""); echo" ". showRow("","","
")." "; echofooter(); } // ******************************************************************************** // Save System Configuration // ******************************************************************************** elseif($action == "dosavesyscon") { if($member_db[1] != 1){ msg("error", "Access Denied", "You don't have permission for this section"); } $handler = fopen("./data/config.php", "w"); fwrite($handler, "$value) { fwrite($handler, "\$config_$name = \"".htmlspecialchars($value)."\";\n\n"); } fwrite($handler, "?>"); fclose($handler); include("./skins/".$save_con["skin"].".skin.php"); msg("info", "Configurations Saved", "The System Configurations were successfully saved."); } ?>