gristy,Mar 16 2005, 07:35 PM wrote:

right, this sounds promising - excuse my ignorance, but is cutehack an online thing?

do i install cutehack onto my webspace, replacing my existing cutenews folder - so that the band can logon as usual - but then have the ability to edit the post times etc?

the only reason i ask, is my main problem is i want my computer illiterate friends to be able to edit the post times online....
[right][snapback]34565[/snapback][/right]


in my signature there is a link to the cutehack forum thread
it provides instructions on how to upgrade from cute news to cute hack
this should be helpful enough, but if not you can let me know and i can attempt a rescue wink

as i had said, cutehack can handle this

in cutehack you can set the date for news (gigs) when adding or editing, and when news is displayed it is automatically displayed in order of the date the post has, not the date it was posted (or reverse order)

therefore if you have a schedule looking like this

monday
wednesday
saturday

and you go to add, and add a show with the date for friday it will display in order like so

monday
wednesday
friday
saturday

gristy,Mar 14 2005, 07:41 PM wrote:

no

in any order you want

so the list of news is totally customisable...
[right][snapback]34224[/snapback][/right]


cutehack automatically arranges them by date (in the case that the dates have been mixed up)

and yes oliver there is an auto archive hack but it doesnt work woth shit on 1.3.6 and cutehack

i can understand preventing modifications of root admin account, but honestly what would the root admin have access to that the regular admin wouldnt

Guest,Feb 27 2005, 06:54 AM wrote:

My suggestions:

1) Different fields for every category, let's say if somebody wants to post in the category "News" for example, when going to Add News, there will be showed all the categories.

If "News" is selected the following the fields will appear:
- Title __________
- Image __________
- Comment __________
- Short Story
_______________
_______________
_______________
- Full Story
_______________
_______________
_______________

If "Articles" is selected, then this will appear, depending on the settings:
- Title __________
- Avatar ____________
- Short Story
_______________
_______________
_______________
- Full Story
_______________
_______________
_______________

And I think that the admin should be able to edit this in a x-field editor or something.
[right][snapback]32101[/snapback][/right]


this can be done with XFields

RDF,Mar 7 2005, 02:38 PM wrote:

Seperating Admin into different sub-groups e.g. Root Admin and Admins, where as Root Admin would be the original owner of CN. Admins could have all the powers of Root Admin, except they cannot change the status and details of the Root Admin or some system settings etc.
[right][snapback]33165[/snapback][/right]


what would be the point of this? what would the root admin have access to that the regular admin's wouldnt?

eruin,Feb 22 2005, 09:27 PM wrote:

http://daringfireball.net/projects/markdown/

It basically gives the user neat ways of formatting text (tables, links, whatever), making paragraphs as appropriate and leaves any html alone smile
[right][snapback]31455[/snapback][/right]


it seems like that kinda removes the "new lines
" option (or would) so i'd rather not, though im sure those who want it could put it in

eruin,Feb 22 2005, 03:11 PM wrote:

The Markdown plugin supplied in AJ-Fork does exactly what you want.

Adding Markdown (which is a presentation-only filter) to cutehack wouldn't be a bad idea, really.'

It's stand-alone, so you only need to include the file then run Markdown($news_content);
[right][snapback]31408[/snapback][/right]


what exactly does it do?

if you notice near the submit button at the bottom there is also a preview button and an options link

if you click options there's a checkbox to convert new lines to
's

if you mean you want that to only effect html tags... nobody wants to put that much effort into it, you either do the whole post with or without the checkbox

oooh so what you're asking is for all spaces to be converted to   so that it doesnt question your spacing

i recomend using <pre> some   spaces  !</pre>
because pre will preserve your spaces and such

that should work... if not i cant help ya

DrJohnDoe,Jan 22 2005, 03:50 PM wrote:

ad add news or edit news i need the following thing

start time, end time

so i can write articles in advance and publish it when i want to. and disable it when i want to.

i tried to find something about in this forum for more than 2 hours. maybe i haven't seen a post.

please help me!

thx
doc
[right][snapback]25876[/snapback][/right]


there is add news in the future, but not disable news after X ammount of time
you could try the auto archive hack
but that means all posts have 1 month before being archived, as of right now there isnt a way to set individual post disable times - could write it yourself though, wouldnt be too hard

Guest,Feb 4 2005, 03:55 PM wrote:

The feauture that journalists articles must pass an editor's check before they really get posted.
[right][snapback]28843[/snapback][/right]


https://cutephp.com/forum/index.php?showtopic=2605
good god it's a F*CKING PINNED TOPIC
i hate newbs... you damned impatient people wont just read things, it was 2 lines below this post...

Name: Ensure Comm_File Validity
Author: NyNe
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description:

CuteNews did not added your comment because there is some problem with the comments database.

This will run through your news.txt and collect news IDs, and match them to IDs in comments.txt, if there is an ID in comments.txt thats not in news.txt it will remove the line - if there is a missing ID in comments.txt it will create a comment line so that new comments can be added.
this is very useful for those of you (like me) who have tampered with your news.txt or comments.txt and need it fixed
Instructions:
Step 1:
If your entire comments.txt is empty, make a seperate file (name it anything you want, as long as you can find it afterwards) with the .php extension naturally, wich you'll locate inside the CuteNews Root directory.
Inside put this code

<?php
echo "Done";
$news_file = "data/news.txt";
$comm_file = "data/comments.txt";
//CODE FROM STEP 3 HERE//
?>

In the case of a completly empty comments.txt this is usually due to too many spam comments. So get some spam protection.
Ofcourse, having alot of news without having ever archived can cause this as well.
When you're done making this file. Go to it 1 time with your browser. The page WILL only show the word "Done".
Running this file a second time migth corrupt your comments.txt again.

Step 2:
If it's just 1 article that randomly has this problem
open ./inc/shows.inc.php
find:

//################################################################################
####################################
if($allow_comments){

add above:
the code from step 3

Step 3:

// Ensure $comm_file is valid - Start AddBlock
// build news
$news_db = file("$news_file");
foreach($news_db as $null => $news_db_line){
    $item_arr = explode("|", $news_db_line);
    $news_item[$item_arr[0]]['n'] = true;
    $news_item[$item_arr[0]]['nv'] = $item_arr[0]."|>|";
}

// build comments
$comm_db = file("$comm_file");
foreach($comm_db as $null => $comm_db_line){
    $item_arr = explode("|", $comm_db_line);
    $news_item[$item_arr[0]]['c'] = true;
    $news_item[$item_arr[0]]['cv'] = str_replace("\n", "", $comm_db_line);
}

// run validation
rsort($news_item); reset($news_item);
$fp = fopen($comm_file, "wb");
foreach($news_item as $null => $comm_item){
    if ($comm_item['n'] == true) {
 if ($comm_item['c'] == true) {
     $news_comm = $comm_item['cv']."\n";
 } else {
     $news_comm = $comm_item['nv']."\n";
 }
 fwrite($fp, $news_comm);
    }
}
fclose($fp);
// Ensure $comm_file is valid - End AddBlock

Name: Choose Date/Time For Posts & Prospective Posting
Author: NyNe
CuteNews Compatibility: 1.3.6 - 1.4.1
Description: What This Hack Does:
This hack will add date/time selector boxes in both add and edit news.
*update: If the time you enter in either edit or add news is the same as a time already in the database it will add 1 second to the time.
*update: When adding or editing news, the news.txt and comments.txt will be sorted by order of timestamp
It will also put an option in the system config for administrators to turn prospective posting on/off.
With prospective posting on, posts that have been written with dates in the future will not display until their date.

credit to maraboli for conceptual coding
credit to fusion news for the date displaying in html forms
Instructions:

open ./inc/options.mdu
find:

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"));


add below:

// <!-- Start ModifyTime v2.0 -->
        showRow("Prospective Posting", "news in the future does not display until its date", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[prospective_posting]", "$config_prospective_posting"));
// <!-- End ModifyTime v2.0 -->


open ./data/config.php
find:

$config_reverse_active = "no";


add under: (change yes to no if you'd like it turned off, can be changed from system config later)

$config_prospective_posting = "yes";


open ./inc/shows.inc.php
find:

if($category and $requested_cats[$news_arr[6]] != TRUE){ continue; }


add above:

// <!-- Start ModifyTime v2.0 -->
if ($config_prospective_posting == "yes") { $current_date = date("U"); if ($news_arr[0] > $current_date) { continue; } }
// <!-- End ModifyTime v2.0 -->


open ./inc/addnews.mdu
find:

if($member_db[1] > 3){ msg("error", "Access Denied", "You don't have permission to add news"); }


add under:

// <!-- Start ModifyTime v2.0 -->
$months = array('01'=>'January', '02'=>'February', '03'=>'March', '04'=>'April', '05'=>'May', '06'=>'June', '07'=>'July', '08'=>'August', '09'=>'September', '10'=>'October', '11'=>'November', '12'=>'December');
if ($config_prospective_posting == "yes") { $prospective_message = "<font style=\"font-size:7pt\">(posts in the future will not be displayed until after their dates)</font>"; } else { $prospective_message = ""; }
$current_time = time()+ ($config_date_adjust*60);
// <!-- End ModifyTime v2.0 -->

find:

    echo "
    <script LANGUAGE=\"JavaScript\">
    function preview(){


add above:

// <!-- Start ModifyTime v2.0 -->
  $month = "<select size=\"1\" name=\"edit_month\">";
  for($i=1;$i<=12;$i++){
    if( $i < 10 ) $i = '0'.$i;
    if( date("m", $current_time) == $i )
      $selected = " selected";
    else
      $selected = "";
    $month .= "<option value=\"$i\"$selected>".$months[$i]."</option>";
  }
  $month .= "</select>";
  $day = "<select size=\"1\" name=\"edit_day\">";
  for($i=1;$i<=31;$i++){
    if( date("j", $current_time) == $i )
      $selected = " selected";
    else
      $selected = "";
    $day .= "<option value=\"$i\"$selected>$i</option>";
  }
  $day .= "</select>";
  $year = "<select size=\"1\" name=\"edit_year\">";
  for($i=(date("Y")-30);$i<=(date("Y")+30);$i++){
    if( date("Y", $current_time) == $i )
      $selected = " selected";
    else
      $selected = "";
    $year .= "<option value=\"$i\"$selected>$i</option>";
  }
  $year .= "</select>";
  $hour = "<select size=\"1\" name=\"edit_hour\">";
  for($i=0;$i<=23;$i++){
    if( date("G", $current_time) == $i )
      $selected = " selected";
    else
      $selected = "";
    $hour .= "<option value=\"$i\"$selected>$i</option>";
  }
  $hour .= "</select>";
  $min = "<select size=\"1\" name=\"edit_min\">";
 for($i=0;$i<=59;$i++){
    if( $i < 10 ) $i = '0'.$i;
    if( date("i", $current_time) == $i )
      $selected = " selected";
    else
      $selected = "";
    $min .= "<option value=\"$i\"$selected>$i</option>";
  }
  $min .= "</select>";
  $sec = "<select size=\"1\" name=\"edit_sec\">";
  for($i=0;$i<=59;$i++){
    if( $i < 10 ) $i = '0'.$i;
    if( date("s", $current_time) == $i )
      $selected = " selected";
    else
      $selected = "";
    $sec .= "<option value=\"$i\"$selected>$i</option>";
  }
  $sec .= "</select>";
// <!-- End ModifyTime v2.0 -->

find:

<form method=post name=addnews action=\"$PHP_SELF\">


add below:

<!-- Start ModifyTime v2.0 -->
       <tr>
       <td valign=middle width=\"75\">
       Date:
       <td width=\"571\" colspan=\"7\">
       $month$day$year
       </tr>
       <tr>
       <td valign=middle width=\"75\">
       Time:
       <td width=\"571\" colspan=\"7\">
       $hour:$min:$sec $prospective_message
       </tr>
<!-- End ModifyTime v2.0 -->

find:

$added_time = time()+ ($config_date_adjust*60);


replace with:

    // <!-- Start ModifyTime v2.0 -->
    $added_time = strtotime("$edit_day ".$months[$edit_month]." $edit_year $edit_hour:$edit_min:$edit_sec");
    // <!-- End ModifyTime v2.0 -->

find:

$all_db = file("./data/news.txt");


add under:

// <!-- Start ModifyTime v2.0 -->
    rsort($all_db); reset($all_db);
// <!-- End ModifyTime v2.0 -->

find:

foreach ($all_db as $line){ fwrite($news_file, "$line");}


replace with:

// <!-- Start ModifyTime v2.0 -->
rsort($all_db);  reset($all_db);
foreach ($all_db as $null => $line){ fwrite($news_file, "$line");}
// <!-- End ModifyTime v2.0 -->

find:

    fwrite($new_com_db, "$added_time|>|\n");
    foreach ($old_com_db as $line){ fwrite($new_com_db, "$line");}


replace with:

// <!-- Start ModifyTime v2.0 -->
    fwrite($new_com_db, "$added_time|>|\n");
    rsort($old_com_db);  reset($old_com_db);
    foreach ($old_com_db as $null => $line){ fwrite($new_com_db, "$line");}
// <!-- End ModifyTime v2.0 -->


open ./inc/editnews.mdu
find:

if($member_db[1] > 3){ msg("error", "Access Denied", "You don't have permission to edit news"); }


add under:

// <!-- Start ModifyTime v2.0 -->
$months = array('01'=>'January', '02'=>'February', '03'=>'March', '04'=>'April', '05'=>'May', '06'=>'June', '07'=>'July', '08'=>'August', '09'=>'September', '10'=>'October', '11'=>'November', '12'=>'December');
if ($config_prospective_posting == "yes") { $prospective_message = "<font style=\"font-size:7pt\">(posts in the future will not be displayed until after their dates)</font>"; } else { $prospective_message = ""; }
// <!-- End ModifyTime v2.0 -->

find:

    echo"
    <script LANGUAGE=\"JavaScript\">
        function preview(){


add above:

// <!-- Start ModifyTime v2.0 -->
  $month = "<select size=\"1\" name=\"edit_month\">";
  for($i=1;$i<=12;$i++){
    if( $i < 10 ) $i = '0'.$i;
    if( date("m", $item_db[0]) == $i )
      $selected = " selected";
    else
      $selected = "";
    $month .= "<option value=\"$i\"$selected>".$months[$i]."</option>";
  }
  $month .= "</select>";
  $day = "<select size=\"1\" name=\"edit_day\">";
  for($i=1;$i<=31;$i++){
    if( date("j", $item_db[0]) == $i )
      $selected = " selected";
    else
      $selected = "";
    $day .= "<option value=\"$i\"$selected>$i</option>";
  }
  $day .= "</select>";
  $year = "<select size=\"1\" name=\"edit_year\">";
  for($i=(date("Y")-30);$i<=(date("Y")+30);$i++){
    if( date("Y", $item_db[0]) == $i )
      $selected = " selected";
    else
      $selected = "";
    $year .= "<option value=\"$i\"$selected>$i</option>";
  }
  $year .= "</select>";
  $hour = "<select size=\"1\" name=\"edit_hour\">";
  for($i=0;$i<=23;$i++){
    if( date("G", $item_db[0]) == $i )
      $selected = " selected";
    else
      $selected = "";
    $hour .= "<option value=\"$i\"$selected>$i</option>";
  }
  $hour .= "</select>";
  $min = "<select size=\"1\" name=\"edit_min\">";
 for($i=0;$i<=59;$i++){
    if( $i < 10 ) $i = '0'.$i;
    if( date("i", $item_db[0]) == $i )
      $selected = " selected";
    else
      $selected = "";
    $min .= "<option value=\"$i\"$selected>$i</option>";
  }
  $min .= "</select>";
  $sec = "<select size=\"1\" name=\"edit_sec\">";
  for($i=0;$i<=59;$i++){
    if( $i < 10 ) $i = '0'.$i;
    if( date("s", $item_db[0]) == $i )
      $selected = " selected";
    else
      $selected = "";
    $sec .= "<option value=\"$i\"$selected>$i</option>";
  }
  $sec .= "</select>";
// <!-- End ModifyTime v2.0 -->

find:

        <td valign=middle width=\"75\">
        Info.
        <td width=\"571\" colspan=\"6\">
        Posted on $newstime by $item_db[1]


replace with:

<!-- Start ModifyTime v2.0 -->
        <tr>
        <td valign=middle width=\"75\">
        Info.
        <td width=\"571\" colspan=\"6\">
        Posted on $newstime by $item_db[1]
        </tr>
        <tr>
        <td valign=middle width=\"75\">
        Date:
        <td width=\"571\" colspan=\"7\">
        $month$day$year
        </tr>
        <tr>
        <td valign=middle width=\"75\">
        Time:
        <td width=\"571\" colspan=\"7\">
        $hour:$min:$sec $prospective_message
        </tr>
        <input type=hidden name=pass_time value=$item_db[0]>
<!-- End ModifyTime v2.0 -->

find:

fwrite($new_db,"$old_db_arr[0]|$old_db_arr[1]|$title|$short_story|$full_story|$editavatar|$category||\n");


replace with:

//<!-- Start ModifyTime v2.0 -->
$converted_input_date=strtotime("$edit_day ".$months[$edit_month]." $edit_year $edit_hour:$edit_min:$edit_sec");
$all_db = file("./data/news.txt"); rsort($all_db); reset($all_db);
foreach($all_db as $null => $news_line){ $news_arr = explode("|", $news_line); if($news_arr[0] == $converted_input_date){ $converted_input_date++; } }
if ($disable_comments != 1) $disable_comments = 0;
fwrite($new_db,"$converted_input_date|$old_db_arr[1]|$title|$short_story|$full_story|$editavatar|$category||\n");
$ccf=""; $converted_com_file = file($com_file);
for ($c = 0; $c < sizeof($converted_com_file); $c++) {$ccf=$ccf.$converted_com_file[$c];}
$fp = fopen($com_file, "wb"); fwrite($fp, str_replace($pass_time,$converted_input_date,$ccf)); fclose($fp);
//<!-- End ModifyTime v2.0 -->

find:

fclose($new_db);


add under:

//<!-- Start ModifyTime v2.0 -->
  $sorted_news = file("./data/news.txt"); sort($sorted_news); reset($sorted_news);
  foreach ($sorted_news as $null => $sorted_news_line) {
      $sorted_news_output = str_replace("\n", "", $sorted_news_line)."\n".$sorted_news_output;
  }
  $fp = fopen($news_file, "wb"); fwrite($fp, $sorted_news_output); fclose($fp);
//<!-- End ModifyTime v2.0 -->

find:

msg("info","Changes Saved","The changes were successfully saved", "$PHP_SELF?mod=editnews&action=editnews&id=$id&source=$source");


replace with:

// <!-- Start ModifyTime v2.0 -->
msg("info","Changes Saved","The changes were successfully saved", "$PHP_SELF?mod=editnews&action=editnews&id=$converted_input_date&source=$source");
// <!-- End ModifyTime v2.0 -->

and you're done!

14

(0 replies, posted in Hacks & Tricks / FAQ)

PART 1:
open ./inc/options.mdu
find:

                 $$template = preg_replace("/</","<",$$template);
                 $$template = preg_replace("/>/",">",$$template);


replace with:

      $$template = htmlspecialchars($$template);


Credit to Stealtheye for Part 1

PART 2:
open ./inc/shows.inc.php
find: (NOTE: there should be 3 of these)

echo $output;


add above: (NOTE: add this above ALL 3)

// Valid Amps
$output = str_replace("&","&", $output);
$output = str_replace("&","&", $output);
// Valid Amps

well Hann i had the hack for #1 made and finished for a while but i just posted it now
https://cutephp.com/forum/index.php?showtopic=4630

and as for the reviews thing
make a new template (copy the current headlines template) and use it for the review headlines
and in both templates replace [full-link] or whatever you're using with [link] and make the link to the pages you need (ex link to www.yoursite.com/reviews.php?id={news-id} or something)

Name: Mail On Comments
Author: NyNe
CuteNews Compatibility: 1.3.6  (higher version have this option build in)
Description: Whenever someone makes a comment, you'll receive an email.
Requirements: CuteMail Hack
Instructions:

open ./inc/options.mdu
find:
[code]     $registrationdate
     </tr>[/code]
add below:
[code]<!--// MailOnComment v1.1 - Start AddBlock-->
"; if(trim($member_db[10]) == 1){ $mail_com = "checked"; }
if($member_db[1] != 4){echo"<tr>
<td height=\"21\" width=\"200\" bgcolor=#F7F6F4>
              mail on comments
<td height=\"21\" width=\"400\" bgcolor=#F7F6F4 >
<input type=checkbox value=\"1\" name=change_mail_on_comment $mail_com>    when someone comments you will recieve an e-mail
</tr>"; }else{ $bg = "bgcolor=#F7F6F4"; } echo "
<!--// MailOnComment v1.1 - End AddBlock-->[/code]
find:
[code]        showRow("Admin Email", "used as sender of mail, if blank mail will be from webmaster@yourdomain", "<input type=text style=\"text-align: center;\"  name='save_con[mail_admin_address]' value='$config_mail_admin_address' size=40>");[/code]
add below:
[code]// MailOnComment v1.1 - Start AddBlock
        showRow("Admin MailOnComment", "admin should always recieve mail when any user comments", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[mail_admin_comments]", "$config_mail_admin_comments"));
// MailOnComment v1.1 - End AddBlock[/code]

open ./inc/addnews.mdu
find:
[code]<input style=\"border:0; background-color:transparent\" type=checkbox value=\"yes\" name=\"if_convert_new_lines\" checked> Convert new lines to
[/code]
add in front of it: (so you get the    on the same line - it might already be there)
[code]<!--// MailOnComment v1.1 - Start AddBlock-->
"; if(trim($member_db[10]) == 1){ $mail_com = "checked"; } echo "
  <input style=\"border:0; background-color:transparent\" type=checkbox value=\"1\" name=\"mail_on_comment\" $mail_com> Recieve mail when this post is commented on

<!--// MailOnComment v1.1 - End AddBlock-->
  [/code]
find:
[code]fwrite($news_file, "$added_time|$member_db[2]|$title|$short_story|$full_story|$manual_avatar|$category||\n");[/code]
replace with:
[code]// MailOnComment v1.1 - Start ChangeBlock
if ($mail_on_comment != 1) $mail_on_comment = 0;
fwrite($news_file, "$added_time|$member_db[2]|$title|$short_story|$full_story|$manual_avatar|$category|$mail_on_comment||\n");
// MailOnComment v1.1 - End ChangeBlock[/code]

open ./inc/editnews.mdu
find:
[code]fwrite($new_db,"$old_db_arr[0]|$old_db_arr[1]|$title|$short_story|$full_story|$editavatar|$category||\n");[/code]
replace with:
[code]   // MailOnComment v1.1 - Start ChangeBlock
   if ($mail_on_comment != 1) $mail_on_comment = 0;
   fwrite($new_db,"$old_db_arr[0]|$old_db_arr[1]|$title|$short_story|$full_story|$editavatar|$category|$mail_on_comment||\n");
   // MailOnComment v1.1 - End ChangeBlock[/code]
find:
[code]<option title="delete all selected news" value="mass_delete">Delete</option>[/code]
add below:
[code]<!--// MailOnComment v1.1 - Start AddBlock-->
<option title="enable/disable mail on comments for selected news" value="mass_mail_comments">Enable/Disable Mail on Comments</option>
<!--// MailOnComment v1.1 - End AddBlock-->[/code]
find:
[code]<input style=\"border:0; background-color:transparent\" type=checkbox value=\"yes\" name=\"if_convert_new_lines\" checked> Convert new lines to
[/code]
add in front of it: (so you get the    on the same line - it might already be there)
[code]<!--// MailOnComment v1.1 - Start AddBlock-->
"; if(trim($item_db[7]) == 1){ $mail_com = "checked"; } echo "
  <input style=\"border:0; background-color:transparent\" type=checkbox value=\"1\" name=\"mail_on_comment\" $mail_com> Recieve mail when this post is commented on

<!--// MailOnComment v1.1 - End AddBlock-->
  [/code]

open ./inc/massactions.mdu
find:
[code]/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  If No Action Is Choosed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */[/code]
add above:
[code]/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Mass MailOnComments v1.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
elseif($action == "mass_mail_comments"){

if(!$selected_news){ msg("error", "Error", "You have not specified any articles", "$PHP_SELF?mod=editnews&action=list&source=$source"); }

echoheader("options", "Enable/Disable Mail On Comments");

echo "<form action=\"$PHP_SELF\" method=post><table border=0 cellpading=0 cellspacing=0 width=100% height=100%><tr><td><select name=mail_comments><option value=\"1\">Enable</option><option value=\"0\">Enable</option></select> mail on comments for these ".count($selected_news)." posts?";

foreach($selected_news as $null => $newsid){
    echo "<input type=hidden name=selected_news[] value=\"$newsid\">";
}

echo " <input type=hidden name=action value=\"do_mass_mail_comments\"><input type=hidden name=source value=\"$source\"><input type=hidden name=mod value=\"massactions\"> <input type=submit value=\"Change\"></td></tr></table></form>";

echofooter();
exit;
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  DO Mass MailOnComments 1.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
elseif($action == "do_mass_mail_comments"){
if(!$selected_news){ msg("error", "Error", "You have not specified any articles", "$PHP_SELF?mod=editnews&action=list&source=$source"); }
if($source == ""){ $news_file = "./data/news.txt";}
else{ $news_file = "./data/archives/$source.news.arch"; }
    $changed_articles = 0;
    $old_db = file("$news_file");
    $new_db = fopen("$news_file", w);
    foreach($old_db as $null => $old_db_line){
  $old_db_arr = explode("|", $old_db_line);
  if(@!in_array($old_db_arr[0], $selected_news)){
   fwrite($new_db,"$old_db_line");
         }
         else
            {
    $have_perm = 0;
       if(($member_db[1] == 1) or ($member_db[1] == 2)){$have_perm = 1;}
       elseif($member_db[1] == 3 and $old_db_arr[1] == $member_db[2]) {$have_perm = 1;}
    if(!$have_perm){ fwrite($new_db,"$old_db_line"); }
                else{
                 fwrite($new_db,"$old_db_arr[0]|$old_db_arr[1]|$old_db_arr[2]|$old_db_arr[3]|$old_db_arr[4]|$old_db_arr[5]|$old_db_arr[6]|$mail_comments||\n");
                 $changed_articles ++;
                }
   }
    }
    fclose($new_db);
if(count($selected_news) == $changed_articles){ msg("info", "News Changed", "All articles that you selected ($changed_articles) were changed successfully", "$PHP_SELF?mod=editnews&action=list&source=$source"); }
else{ msg("error", "News Changed (with errors)", "Only $changed_articles of ".count($selected_news)." articles that you selected were changed successfully", "$PHP_SELF?mod=editnews&action=list&source=$source"); }
}[/code]

open ./inc/shows.inc.php
find:
[code]//################################################################################
####################################
//                         Add Comment
//################################################################################
####################################[/code]
add above:
[code]//################################################################################
####################################
//                         Check for MailOnComment v1.1
//################################################################################
####################################
$all_news = file("$news_file");
    while (list(, $news_data) = each($all_news)){
    $news_data = explode("|",$news_data);
    if(($id == $news_data[0]) && ($news_data[7] == 1)){
  $mail_on_comment_run = TRUE;
  while (list(, $user) = each($all_users)){
   $user_arr = explode("|",$user);
   if ($news_data[1] == $user_arr[2]) {
    $mail_on_comment_address = $user_arr[5];
   }
  }
    }
}[/code]
find:
[code]            $found = TRUE;
        }else{
                        fwrite($new_comments, $old_comments_line);[/quote]
add above:
[code]// MailOnComment v1.1 - Start AddBlock
if ($mail_on_comment_run == true) {
$all_news = file("$news_file");
while (list(, $news_data) = each($all_news)){
    $news_arr = explode("|",$news_data);
    if ($news_arr[0] == $old_comments_arr[0] && isset($news_arr[2]) && $news_arr[2] != "") {
  $mail_comment = html_entity_decode(preg_replace(array("'
'", "'
'", "'|'", "'\\''"), array("\n", "\n", "|", "\'"), $comments), ENT_QUOTES);
  $mail_name = html_entity_decode(preg_replace(array("'|'", "'\\''"), array("|", "\'"), $name), ENT_QUOTES);
  $mail_title = html_entity_decode(preg_replace(array("'|'", "'\\''"), array("|", "\'"), $news_arr[2]), ENT_QUOTES);
  $send_them_mail = "";
  if(preg_match("/^[\.A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $mail)){ $send_them_mail = "\n Send them mail: $mail"; }
  cute_mail($mail_on_comment_address, "Your post has received a comment", "$mail_name has commented on your post: \n $mail_title $send_them_mail \n\n Comment: \n $mail_comment");
  if ($config_mail_admin_comments == "yes") { cute_mail($config_mail_admin_address, "$news_arr[1]'s post has received a comment", "$mail_name has commented on $news_arr[1]'s post: \n $mail_title $send_them_mail \n\n Comment: \n $mail_comment"); }
    }
}}
// MailOnComment v1.1 - End AddBlock[/code]

Name: Different Image Directories For Each User
Author: Sandro & NyNe
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Give each user his own folder where he may upload/use images. Admin has full rights.
Instructions:

open ./data/config.php
find:

?>


add above:

$config_path_image_upload = "./data/upimages";

$config_user_image_upload = "yes";

$config_user_image_delete = "yes";

open ./inc/options.mdu
find:

    echo"
    <input type=hidden name=mod value=options>
    <input type=hidden name=action value=dosavesyscon>".


add above:

        showRow("Image Directory", "folder where images will be saved", "<input type=text style=\"text-align: center;\"  name='save_con[path_image_upload]' value='".str_replace("/".$username, "", $config_path_image_upload)."' size=40>");

        showRow("User Image Directories", "if yes, users keep their images in their own image directories", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[user_image_upload]", "$config_user_image_upload"));

        showRow("Users Can Delete Images", "if yes, users can delete images", makeDropDown(array("yes"=>"Yes","no"=>"No"), "save_con[user_image_delete]", "$config_user_image_delete"));


find:

                    array(
                           'name'                => "Manage Uploaded Images",
                           'url'                => "$PHP_SELF?mod=images",
                           'access'        => "1",
                    ),


replace with:

                    array(
                           'name'                => "Manage Uploaded Images",
                           'url'                => "$PHP_SELF?mod=images",
                           'access'        => "3",
                    ),

open ./inc/images.mdu
find:

if($member_db[1] > 3 or ($member_db[1] != 1 and $action == "doimagedelete")){ msg("error", "Access Denied", "You don't have permission to manage images"); }


replace with:

if($member_db[1] > 3 or ($member_db[1] != 1 and $action == "doimagedelete" and $config_user_image_delete == "no")){ msg("error", "Access Denied", "You don't have permission to manage images"); }

open ./index.php
find:

$config_path_image_upload        = "./data/upimages";


replace with:

/* DIFDU v1.0
$config_path_image_upload        = "./data/upimages"; */


find:

require_once("./data/config.php");


add below:

// Start DIFDU v1.0
if ($config_user_image_upload == "yes") { $config_path_image_upload .= "/$username"; }
// End DIFDU v1.0


find:

/* END Login Authorization using SESSIONS */
}


add below:

// Start DIFDU v1.0
if (!is_dir($config_path_image_upload) && $member_db[1] < 4) {
   mkdir($config_path_image_upload);
   @chmod($config_path_image_upload, 755);
}
// End DIFDU v1.0

Name: show random article
Author: NyNe
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Allows you to show a random article on your site. You can limit this article inside a certain category(s)
Instructions:

create a file called show_random.php in the CuteNews root folder and put this in it

<?
// show_random.php
error_reporting (E_ALL ^ E_NOTICE);
$cutepath =  __FILE__;
$cutepath = preg_replace( "'\\\show_random\.php'", "", $cutepath);
$cutepath = preg_replace( "'/show_random\.php'", "", $cutepath);
$news = file($cutepath."data/news.txt");
shuffle($news);
$i = 0;
$newsids = array();
foreach ($news as $news_line) {
$news_arr = explode("|", $news_line);
if (isset($category) && !stristr($category, $news_arr[6])) { continue; }
$newsids[$i] = $news_arr[0];
$i++;
}
$randid = mt_rand(0, count($newsids)-1);
$subaction = "showfull";
$id = $newsids[$randid];
include($cutepath."show_news.php");
?>

then include the file as if it were show_news.php like so

<?
$category = "1,2"; // whatever categories you want (or dont set any)
$template = "Headlines"; // whatever template you want (or dont set one)
include ("/cutepath/show_random.php");
?>


i dont think other variables are really too useful unless you have
hacks installed that use more

NOTE: this will display the full story of whatever article, NOT THE SHORT STORY unless you make a new template for it

Name: Filter By Letter
Author: NyNe
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: If you want to show article that start with a certain letter in the title, author, short story or full story.
Instructions:
open shows.inc.php
find:

$news_arr = explode("|", $news_line);


add below:

// Filter Letter - Start addblock
// To specify filtering, put the following in your include code:
// $filter_letter[X] = Y;
// Where X is a number from 1-4, which mean the following:
//  1 = filter by author
//  2 = filter by title
//  3 = filter by short story
//  4 = filter by long story
// And Y is the character you'd like to filter by.
// ex: $filter_letter[3] = C; will show articles who's short story start with C
if (isset($filter_letter[$arr])) {
$fl = trim($news_arr[$arr]);
$fl = strtolower($fl{0});
$filtered_letter = strtolower($filter_letter[$arr]);
if ($filtered_letter != $fl) { continue; }
}
// Filter Letter - End addblock

NOTE: it's not case sensitive

Name: Purge old Users
Author: NyNe
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Add a module to your CuteNews panel wherethrough you can easily delete inactive users.
Demo: http://www.shadowdark.net/imghost/purgeusers1.gif http://www.shadowdark.net/imghost/purgeusers2.gif
Instructions:

create ./inc/purgeusers.mdu

<?PHP

if($member_db[1] != 1){ msg("error", "Access Denied", "You don't have permission to purge users"); }
// ********************************************************************************
// Pick which users to list
// ********************************************************************************
if($action == "pick") { echoheader("users","Purge Users");
echo "

<form method=POST name=purgeusers action=\"$PHP_SELF?mod=purgeusers&action=listusers\">
Display users who have not logged in for:

<input type=text name=years value=0 size=4 tabindex=1> years,
<input type=text name=months value=0 size=4 tabindex=1> months,
<input type=text name=weeks value=0 size=4 tabindex=1> weeks,
<input type=text name=days value=0 size=4 tabindex=1> days.

<input style=\"border: 0px; background:transparent;\" type=checkbox value=yes name=show_never_logins> Show users who have never logged in.

<input type=submit value=\"Display Users\" accesskey=\"d\">

</form>

";
echofooter(); }
// ********************************************************************************
// List picked users
// ********************************************************************************
elseif($action == "listusers")
{
    echoheader("users","Purge Users");

    echo '<form method=POST name="purgeusers" action="'.$PHP_SELF.'?mod=purgeusers&action=mass_delete">';
    echo "<script language='JavaScript' type='text/javascript'>
<!--
function ckeck_uncheck_all() {
        var frm = document.purgeusers;
        for (var i=0;i<frm.elements.length;i++) {
                var elmnt = frm.elements[i];
                if (elmnt.type=='checkbox') {
                        if(frm.master_box.checked == true){ elmnt.checked=false; }
            else{ elmnt.checked=true; }
                }
        }
        if(frm.master_box.checked == true){ frm.master_box.checked = false; }
    else{ frm.master_box.checked = true; }
}

-->
</script>"; echo'
<table border=0 cellpading=0 cellspacing=0 width=654>
    <td width=650 colspan="6">
    [b]Inactive Users[/b]
    </tr>

<!-- // Sort users v1.0 - Start addblock -->
    <tr>
    <td width=120 bgcolor="#F7F6F4">
     [u]Username[/u] [[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=2&sortad=a]A[/url]][[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=2&sortad=d]D[/url]]
    <td width=220 bgcolor="#F7F6F4">
    [u]Registration Date[/u] [[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=0&sortad=a]A[/url]][[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=0&sortad=d]D[/url]]
    <td width=2 bgcolor="#F7F6F4">
     
    <td width=220 bgcolor="#F7F6F4">
    [u]Last Login[/u] [[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=9&sortad=a]A[/url]][[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=9&sortad=d]D[/url]]
    <td width=132 bgcolor="#F7F6F4">
    [u]Access Level[/u] [[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=1&sortad=a]A[/url]][[url=https://cutephp.com/forum/index.php?mod=purgeusers&action=listusers&sortus=1&sortad=d]D[/url]]
    <td width=21 bgcolor="#F7F6F4" align="center">
    <input style="border: 0px; background:transparent;" type=checkbox name=master_box title="Check All" onclick="java script:ckeck_uncheck_all()" checked>
    </tr>';

    $all_users = file("./data/users.db.php");
if (isset($sortus)) {
if (!function_exists('sortcmp')) {
 function sortcmp($a, $b) {
  global $all_users, $sortus;

  $users_a = explode('|', $all_users[$a]);
  $users_b = explode('|', $all_users[$b]);

  return strnatcasecmp($users_a[$sortus], $users_b[$sortus]);
 }
}
uksort($all_users, 'sortcmp');
if ($sortad=="d") { $all_users = array_reverse($all_users); }
Unset($sortus);
}
// Sort users v1.0 - End addblock
    $i = 1;
    foreach($all_users as $null => $user_line)
    {
        $i++; $bg = "";
        if($i%2 == 0){ $bg = "#f7f6f4"; }
        if(!eregi("<\?",$user_line)){
        $user_arr = explode("|", $user_line);

        if(isset($user_arr[9]) and $user_arr[9] != ''){ $last_login = date('r',$user_arr[9]); }
        else{ $last_login = 'never'; }

        $inactive_time = time()-$user_arr[9];
        $old_time = 31536000*$years + 2628000*$months + 604800*$weeks + 86400*$days;
        if ($inactive_time <= $old_time && $last_login != "never") { continue; }
        if ($show_never_logins != "yes" && $last_login == "never") { continue; }

        switch($user_arr[1]){
        case 1: $user_level = "administrator"; break;
        case 2: $user_level = "editor"; break;
        case 3: $user_level = "journalist"; break;
        case 4: $user_level = "commenter"; break;
        case 5: $user_level = "banned"; break;
        }
        echo"<tr bgcolor=\"$bg\" title='$user_arr[2]'s last login was on: $last_login'>
  <td>
      $user_arr[2]
  <td>";
     echo( date("F, d Y @ H:i a",$user_arr[0]) );
  echo"<td>
  <td>
";
if(isset($user_arr[9]) and $user_arr[9] != ''){ $last_login = date("F, d Y @ H:i a",$user_arr[9]); }
else{ $last_login = 'never'; }
echo $last_login;
echo"
  <td>
      $user_level
  <td>
     <input name=\"selected_users[]\" value=\"{$user_arr[0]}\" style=\"border:0; background-color:$bg\" type='checkbox' checked>
     </tr>";
  }
    }

    echo"<tr><td colspan=6 align=center>[url=][ Go Back ][/url] <img src=\"skins/images/blank.gif\" height=100% width=300> <input type=submit value=\"Delete Users\" accesskey=\"d\">
</form></table>";

    echofooter();
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Mass Delete
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if($action == "mass_delete"){

if(!$selected_users){ msg("error", "Error", "You have not specified any users", "$PHP_SELF?mod=purgeusers&action=listusers"); }

echoheader("options", "Delete Users");
echo "<form method=post action=\"$PHP_SELF\"><table border=0 cellpading=0 cellspacing=0 width=100% height=100%><tr><td >
Are you sure you want to delete all selected users ([b]".count($selected_users)."[/b]) ?


<input type=button value=\" No \" onclick=\"java script:document.location='$PHP_SELF?mod=purgeusers&action=listusers'\">   <input type=submit value=\"   Yes   \">
<input type=hidden name=action value=\"do_mass_delete\">
<input type=hidden name=mod value=\"purgeusers\">";
foreach($selected_users as $null => $userid){
    echo "<input type=hidden name=\"selected_users[]\" value=\"$userid\">\n";
}
echo "</td></tr></table></form>";

echofooter();
exit;

}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Do Mass Delete
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
elseif($action == "do_mass_delete"){
if(!$selected_users){ msg("error", "Error", "You have not specified any users to be deleted", "$PHP_SELF?mod=purgeusers&action=listusers"); }
$user_file = "data/users.db.php";

$deleted_users = 0;

// Delete News
    $old_db = file("$user_file");
    $new_db = fopen("$user_file", w);
    foreach($old_db as $null => $old_db_line){
  $old_db_arr = explode("|", $old_db_line);
  if(@!in_array($old_db_arr[0], $selected_users)){
      fwrite($new_db,"$old_db_line");
            }
         else
            {
    $have_perm = 0;
          if(($member_db[1] == 1) or ($member_db[1] == 2)){$have_perm = 1;}
          elseif($member_db[1] == 3 and $old_db_arr[1] == $member_db[2]) {$have_perm = 1;}
    if(!$have_perm){ fwrite($new_db,"$old_db_line"); }
                else{$deleted_users ++;}
      }
    }
    fclose($new_db);


if(count($selected_users) == $deleted_users){ msg("info", "Deleted Users", "All users that you selected ([b]$deleted_users[/b]) were deleted", "$PHP_SELF?mod=purgeusers&action=listusers"); }
else{ msg("error", "Deleted Users (some errors occured !!!)", "$deleted_users of ".count($selected_users)." users that you selected were deleted", "$PHP_SELF?mod=purgeusers&action=listusers"); }
}
?>

open ./inc/options.mdu
find:

                    array(
                           'name'                => "Edit Categories",
                           'url'                => "$PHP_SELF?mod=categories",
                           'access'        => "1",
                    ),


add below:

                    array(
                           'name'                => "Purge Users",
                           'url'                => "$PHP_SELF?mod=purgeusers&action=pick",
                           'access'        => "1",
                    ),

open ./index.php
find:

'editusers'                => 'admin',


add below:

'purgeusers'                => 'admin',

21

(2 replies, posted in Hacks & Tricks / FAQ)

this hack is just a function used by other hacks i have made - look for them

22

(0 replies, posted in Hacks & Tricks / FAQ)

open functions.inc.php (inc folder)
find (bottom line):

?>


add above:

////////////////////////////////////////////////////////
// Function:         makeRandomPassword Version: 1.0
// Description: Make a random password
function makeRandomPassword() {
  $salt = "abchefghjkmnpqrstuvwxyz0123456789";
  $pass = "";
  srand((double)microtime()*1000000);
      $i = 0;
      while ($i <= 7) {
      $num = rand() % 33;
      $tmp = substr($salt, $num, 1);
      $pass = $pass . $tmp;
      $i++;
      }
      return $pass;
}

this will be used for register.php and lostpass.php, and it could be useful elsewhere as well

23

(2 replies, posted in Hacks & Tricks / FAQ)

open functions.inc.php (inc folder)
find (bottom line):

?>


add above:

////////////////////////////////////////////////////////
// Function:      cute_mail Version: 1.0
// Description: Send mail with cutenews
function cute_mail($to,$subject,$message){
// PHP Mail Headers
// http://us2.php.net/manual/en/function.mail.php
if (!isset($config_mail_admin_address) || $config_mail_admin_address == "") {
    $mail_from = "webmaster@".str_replace("www.","",$_SERVER['SERVER_NAME']);
} else {
    $mail_from = $config_mail_admin_address;
} $mail_headers = "";
$mail_headers .= "From: $mail_from\n";
$mail_headers .= "Reply-to: $mail_from\n";
$mail_headers .= "Return-Path: $mail_from\n";
$mail_headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n";
$mail_headers .= "MIME-Version: 1.0\n";
$mail_headers .= "Content-type: text/plain; charset=US-ASCII\n";
$mail_headers .= "Content-transfer-encoding: 7bit\n";
$mail_headers .= "Date: " . date('r', time()) . "\n";
$mail_headers .= "X-Priority: 3\n";
$mail_headers .= "X-MSMail-Priority: Normal\n";
$mail_headers .= "X-Mailer: PHP\n";
$mail_headers .= "X-MimeOLE: Produced By CuteNews\n";
mail($to,$subject,$message,$mail_headers) or die("Can not send mail.");
}

open options.mdu (inc folder)
find:

   echo"
   <input type=hidden name=mod value=options>
   <input type=hidden name=action value=dosavesyscon>".


add above:

      showRow("Admin Email", "used as sender of mail, if blank mail will be from webmaster@yourdomain", "<input type=text style=\"text-align: center;\" name='save_con[mail_admin_address]' value='$config_mail_admin_address' size=40>");

After Uploading: go to the system config page (under options in the script) and set the admin email address (or leave it blank) just make sure you click save (blank or not) so it creates the variable in the config

this will be used for register.php, lostpass.php, and the "author recieves email when someone comments on their post" hack

in general it's freaking useful, in the future it might include smtp support (if anyone wants to help me out with that)

use the word wrap feature (should fix it)

*UPDATE*
i modified it today so that the username is now the foldername (lowercase no spaces) and the nickname is just what is displayed in the links, title, and on the posts

http://www.shadowdark.net/eric/

<?
$sd_bgcolor      =    "#000000";
$sd_textcolor  =    "#ffffff";
$sd_linkcolor  =    "#888888";
$ds_linkhover  =    "#bbbbbb";
$sd_cellbg      =    "#330000";
$sd_bordercolor    =    "#555555";
$ds_font_family    = "verdana";
$ds_font_size  =    "10";
$author        = "eric";

// header
include("/home/shadowda/public_html/inc/header.php");
// journal
$show_dh=TRUE;
$category = "1";
$sortby = $_GET['sortby'];
$start_from = $_GET['start_from'];
$number = "10";
$only_active=TRUE;
include("/home/shadowda/public_html/update/show_news.php");
// footer
include("/home/shadowda/public_html/inc/footer.php");
?>

/home/shadowda/public_html/inc/header.php

<?
if ($author == "sds") { $title_nick = ""; $journal_nick = "Shadow Dark"; unset($author); }
elseif ($author == "sdc") { $title_nick = "Community"; $journal_nick = "Shadow Dark Community"; unset($author); $link_nick = "community"; }
else {
    $users_file = file("/home/shadowda/public_html/update/data/users.db.php");
    foreach($users_file as $user_line){
  $user_arr = explode("|", $user_line);
  if(stristr("|".$user_arr[2]."|", "|".$author."|")){ $title_nick = $user_arr[4]; $journal_nick = $user_arr[4]."'s Journal"; $link_nick = str_replace(" ", "", strtolower($user_arr[2])); }
    }
}
echo <<<html
<title>.:ShadowDark:. $title_nick</title>
<style> body { margin:0; background-color: $sd_bgcolor; color: $sd_textcolor; font-family: $ds_font_family; font-size: $ds_font_size; } td { color: $sd_textcolor; font-family: $ds_font_family; font-size: $ds_font_size; } a { color: $sd_linkcolor; } a:hover { color: $ds_linkhover; } textarea, input, object, select { font-family: $ds_font_family; font-size: $ds_font_size; background-color: $sd_cellbg; color: $sd_textcolor; border: 1px $sd_bordercolor solid; } </style><center>
<a name="top"></a>
<table width="100%" bgcolor="$sd_bordercolor" border="0" cellspacing="1" cellpadding="5"><tr><td bgcolor="$sd_cellbg" align="center">[url=http://www.shadowdark.net/$link_nick]$journal_nick[/url]</td></tr></table>
<table width="75%" border="0" cellspacing="10" cellpadding="0"><tr><td valign="top" align="center">
html;
?>

/home/shadowda/public_html/inc/footer.php

<? echo "</td></tr></table>"; ?>

/home/shadowda/public_html/update/data/Default.tpl

<?PHP
///////////////////// TEMPLATE Default /////////////////////
$template_active = <<<HTML
<table width="99%" border="0" cellspacing="0" cellpadding="5">
    <tr><td width="10%"></td>
  <td width="100%">
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="$sd_bordercolor">
  <tr>
    <td bgcolor="$sd_cellbg" width="100%">[b]{title}
  {author}[/b]</td>
    <td bgcolor="$sd_cellbg">
      <table border="0" cellspacing="0" cellpadding="0" width="130"><tr><td>[b]{date}
Eastern Standard Time[/b]</td></tr></table>
    </td>
  </tr>
  <tr>
    <td bgcolor="$sd_cellbg" colspan="2">
      {short-story}
    </td>
  </tr>
  <tr>
    <td bgcolor="$sd_cellbg">
      [full-link]Read More ...[/full-link]
    </td>
    <td bgcolor="$sd_cellbg">
      [com-link]{comments-num} Comments[/com-link]
    </td>
  </tr>
</table>
  </td>
    </tr>
</table>
HTML;


$template_full = <<<HTML
<table width="99%" border="0" cellspacing="0" cellpadding="5">
    <tr><td width="10%"></td>
  <td width="100%">
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="$sd_bordercolor">
  <tr>
    <td bgcolor="$sd_cellbg" width="100%">[b]{title}
  {author}[/b]</td>
    <td bgcolor="$sd_cellbg">
      <table border="0" cellspacing="0" cellpadding="0" width="130"><tr><td>[b]{date}
Eastern Standard Time[/b]</td></tr></table>
    </td>
  </tr>
  <tr>
    <td bgcolor="$sd_cellbg" colspan="2">
      {full-story}
    </td>
  </tr>
  <tr>
    <td bgcolor="$sd_cellbg">
      {views} views
    </td>
    <td bgcolor="$sd_cellbg">
      [com-link]{comments-num} Comments[/com-link]
    </td>
  </tr>
</table>
  </td>
    </tr>
</table>
HTML;


$template_comment = <<<HTML
<table width="99%" border="0" cellspacing="0" cellpadding="5">
    <tr><td width="15%"></td>
  <td>
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="$sd_bordercolor">
  <tr>
    <td bgcolor="$sd_cellbg" width="100%">
      {author}
    </td>
    <td bgcolor="$sd_cellbg">
      <table border="0" cellspacing="0" cellpadding="0" width="130"><tr><td>[b]{date}
Eastern Standard Time[/b]</td></tr></table>
    </td>
  </tr>
  <tr>
    <td bgcolor="$sd_cellbg" colspan="2">
      {comment}
    </td>
  </tr>
</table>
  </td>
    </tr>
</table>

HTML;


$template_form = <<<HTML
<table width="99%" border="0" cellspacing="0" cellpadding="5">
    <tr><td height="20" colspan="2">
<table width="100%" height="100%" bgcolor="$sd_bordercolor" border="0" cellspacing="1" cellpadding="5"><tr><td bgcolor="$sd_cellbg">: p o s t   c o m m e n t :</td></tr></table>
    </td></tr>
    <tr><td width="10%"></td>
  <td width="100%">
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="$sd_bordercolor">
  <tr>
    <td bgcolor="$sd_cellbg" colspan="2">
        <div align="center">y o u r : n a m e <input type="text" name="name" tabindex="1">

        y o u r : e m a i l <input type="text" name="mail" tabindex="2">

        :: c o m m e n t ::

        <textarea cols="60" rows="15" name="comments" tabindex="3"></textarea>

        <script>displaylimit('document.comment.comments',{config_comment_max_long})</script>
 <input type="submit" name="submit" value="Add My Comment" accesskey="s">

        <input type=checkbox name=CNremember id=CNremember value=1> <label for=CNremember>Remember Me</label> | <input type="button" value="Forget Me" onclick="javascript:CNforget();"></div>
    </td>
  </tr>
</table>
  </td>
    </tr>
</table>

HTML;


$template_prev_next = <<<HTML
<table width="100%" height="100%" bgcolor="$sd_bordercolor" border="0" cellspacing="1" cellpadding="5"><tr><td bgcolor="$sd_cellbg" align="center">[prev-link]<< Previous[/prev-link] {pages} [next-link]Next >>[/next-link]</td></tr></table>
HTML;
$template_comments_prev_next = <<<HTML
<table width="100%" height="100%" bgcolor="$sd_bordercolor" border="0" cellspacing="1" cellpadding="5"><tr><td bgcolor="$sd_cellbg" align="center">[prev-link]<< Older[/prev-link] ({pages}) [next-link]Newest >>[/next-link]</td></tr></table>
HTML;
?>

and i have a Default_dh.tpl but i dont think i need to put it up here cuz you get the point

you have to do the editing by actually opening default.tpl because editing it through the template editor in the script wont work properly (the php variables will dissapear)

that's all pretty self explanitory if you just read the code (i have quite a few hacks installed so dont expect your script to have everything above if it doesnt)

Posts found: 1 to 25 of 52

Pages 1 2 3 Next

CutePHP Forums → Posts by NyNe