This is an article by lupocreative and branched off code from Bentheo - I did not write this article to any questions refer it to them members.
This is more a tutorial then a hack since we're trying to integrate a javascript into CuteNews. You might just as well use some other ticker script as many well written javascript can be used to make something beautifull when combined with CuteNews.

limecity,Jun 16 2005, 05:12 AM wrote:

Could anyone guide me step by step?

I created a new template called ticker.
So what do i put inside?

Next what I do?
How do i call the ticker from my html website?

Where should the javascript ticker be in? the template or the site pages?
I am lost.
<div align="right">&lt;{POST_SNAPBACK}&gt;</div>

OK, it took me a while to get there too, but don't panic!

1. First, log in to your server's CuteNews admin panel - http://yourserver/path/to/cutenews/index.php

2. Click "Options" in the header navigation.

3. Click "Edit Templates".

4. Click "create new template".

5. Create a new template based on HEADLINES with name "ticker" (without quotes) - click "Create Template".

6. Now you need to go and edit that new ticker template.  If you click "go back" from that last screen, it will take you back to the Edit Templates screen.  In the pull-down, Switch to Template: "ticker" and click "Go".

7. The template editor will switch to the ticker template.  In the bottom half of this screen, under "Edit Template Parts", click "Active News" and an editor will show underneath.  Type this code into the editor:

[link]{title}[/link]    


- actually add in around 20-30 of the space characters rather than the four you've just added above - trust me, the ticker looks better with a load of spaces after each news item.  Also note that you cannot simply use your spacebar to add in spaces - html will only render the first spacebar inserted space, after which you need to specify additional spaces with the ascii code - for a space, that's ampersand n b s p semicolon.

8. Click "Save Changes".  Please note that if you go and edit this template ever again, you will need to replace the spaces with the ascii code for spaces.  The system automatically converts the ascii code to spacebar inserted spaces when you open the template up in the editor.

9. You're done with all the edits in CuteNews.

10. You now need to insert the javascript into your site pages (NOT CuteNews) where you want the ticker to be shown. Find the point in your html where you want to insert it and paste:

<script language="JavaScript1.2">

/*
Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="400px"
//Specify the marquee's height
var marqueeheight="20px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=2
//configure background color:
var marqueebgcolor="#99cc99"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var marqueecontent='<nobr><p>[b]<?PHP $number = 5; $template = "ticker"; include("cutenews/show_news.php"); ?>[/b]</p></nobr>'


////NO NEED TO EDIT BELOW THIS LINE////////////
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:2px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0px top=2px onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>

11. Now adjust the settings at the top of the script to suit your site - marqueewidth, marqueeheight, marqueespeed, marqueebgcolor.

12. This is the MOST IMPORTANT thing: check that your entire "var marqueecontent" statement is on ONE line, that's from the start apostrophe to the end apostrophe.  It will not work unless it is.

13. In order to adjust the number of headlines shown, you can change "$number = 5" to whatever number you wish.

14. If your CuteNews installation is in a relative directory different to the one shown above in the var marqueecontent example, adjust it appropriately.  Eg: ../../path/to/installationdirectory/show_news.php

14. Publish your web page.  You MUST preview your site using the http address, not a file address, otherwise the javascript won't render in the browser.

15. Providing none of your headlines contain any apostrophes, it should work just fine.  If it still isn't working, and you're sure there's no apostrophes, double check your var marqueecontent statement - it MUST be all on one line and must start and end with a single apostrophe.

16. Once you have got a working ticker, you might need to play with the formatting of the text in the ticker.  In my example above, it uses the default paragraph p style set for the page (so if you're using CSS it will inherit from that), and the text is bold.  It will also use your default hyperlink a formatting.  You may wish to adjust all of that.  To change the formatting of the hyperlinks in the ticker, I think you will need to do it within a div tag, as I don't think you can stipulate a class directly in the CuteNews template editor.  Add a hyperlink class to your CSS then in the javascript, change the var marqueecontent to:

var marqueecontent='<nobr><p><div class="yournewhyperlinkclass"><?PHP $number = 5; $template = "ticker"; include("cutenews/show_news.php"); ?></div></p></nobr>'

17. Similarly, you may need to adjust the padding.  In my example above, I stipulate a 2px padding at the top to lower the scrolling text a little.  It is stipulated in two places: under the "if (iedom)" argument and "else if (document.layers)" argument toward the bottom of the script.

18. You may wish to add a PHP_SELF element if you want to redirect your visitors to another page.  For example, I wanted visitors to land up on html/announcements.php where the CuteNews served news usually resides.  To do that, change your var marqueecontent statement to:

var marqueecontent='<nobr><p>[b]<?PHP $PHP_SELF = 'path/to/page.php'; $number = 5; $template = "ticker"; include("cutenews/show_news.php"); ?>[/b]</p></nobr>'

Hope this all helps.  And once again, it would be wrong of me not to say thanks to Bentheo.  He put this together, I have simply made it a bit easier to follow - HOPEFULLY!  https://cutephp.com/forum/style_emoticons/default/wink.gif

Simon

feverpitchsite:
thats an upcoming modification, either in the next version or the version after that version smile

RTL:
been discussed and I don't think many people are up for it, it takes away the flat-file relationship that cutenews prides itself on.  Plus many people don't have a sql host or have a clue how to setup SQL based news systems.  Take a look in the forums, you really think some people need to be confused more than they already are? tongue

3

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

I can honestly say I have not tried this yet but it sounds like it works and the coding involved looks to be whats needed smile

Great work V4NY smile

Its a news management system here people, try and remember that tongue

RDF,Mar 7 2005, 07:53 PM wrote:

Added security, stopping the users from altering any configuration or the root admin accounts. This is something that is used many software packages such as IPB.
[right][snapback]33171[/snapback][/right]

Isn't that like having one admin user and multiple editors in cutenews language?

IPB has one admin here (Flexer) and multiple moderators.

Flex has control over site, we dont.
Flex has control over mass-banning, we dont.
Flex can backup and pull down this forum, we cant.

Its kinda like editors and admins in cutenews.

Admins can do system options, Editors cant.
Admins can adjust templates, Editors cant.
etc etc.

You get my drift? smile

6

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

I'll do this article to help people, its going to be quite excessive so please try to follow me as best you can (even if your HTML/CSS is not very good, rely on common knowledge for this!):

CSS can work in divs, layers and floats.
Floats can be classes, classes can be set as specific widths.

So, your float must be left or right, pick one, preferrably left.
Your container can be a class (for XHTML validity).
You can style this "container" class in CSS, I recommend you do.

The first thing you need is your container.  This will be your "Box" so you do:

<div class="container">text here</div>

Inside this container, you will be using the float: left; commands found in CSS, please look them up if you are not very familiar with how they work.   Here is your first example:

<div class="container">
<php
$template="left";
include('show_news.php');
?>
</div>

You see i added a specific template here. Let's make that template called "left".
If you're done, put everything from the active news subtemplate part inside

<div class="left">
active news template code
</div>

Now for four columns you need to specify the width of each class inside the container.  The class "left" will begin to look like this:

.left {
float: left;
width: 25%; // or its best to use 24% sometimes!
}


CSS is not added in the templates but in the file that contains the CN include code.
If you don't know how to add css to a file, google for it as there are different ways to do it and everyone has his own preference.

Ok your code as ouputed by the browser should now look like:

<div class="container">
<div class="left">news</div>
<div class="left">news</div>
<div class="left">news</div>
<div class="left">news</div>
</div>

See how there is 4 news and each one is beside another?... Now becuase you have specified a WIDTH in each of the class="left" above when you add a FIFTH news item, it will drop down BELOW the first, a SIXTH will be below the second, a SEVENTH will be below the third and so on so forth.

Hope thats KINDA helped you guys out https://cutephp.com/forum/style_emoticons/default/smile.gif


For 4 columns on 5 rows
You just need to put $number = "20"; in your cutenews include code!

Name: Show news Over X amount of days/weeks/months/years
Author: John/Will
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Adds the ability to use an additional variable with your CN include code. So post will show for a set amount of time. This is not the same as individual expiration date.
Instructions:
open shows.inc.php
:::::::::::::::::::::::::::::::::::::::::::::::::::

Find:
:::::::::::::::::::::::::::::::::::::::::::::::::::

elseif($showed == $number){  break; }   
}


add below:
:::::::::::::::::::::::::::::::::::::::::::::::::::

  //show news per day hack
  if (isset($show_from)) {
  if ((time() - $news_arr[0]) > $show_from * 3600) {
  break; 
  }
  }
  //show news per day hack


USEAGE
:::::::::::::::::::::::::::::::::::::::::::::::::::

in the cutenews include code use:
:::::::::::::::::::::::::::::::::::::::::::::::::::

  $show_from = 24; for one day
  $show_from = 24 * 7; for one week
  etc

Credits to Jetski - A slight fix to the above, nothing significant, I modified the above to work with the Fork... I have not tested it yet so please, someone, test this and get back to me!

THIS IS THE FIX FOR AJ-FORK v.1xx

1. Open up shows.inc.php in the inc folder of cutenews for editing and find:

$nextcstart = $cstart + $cnum;

3. Above the code shown above paste in the code below

if(count($individual_comments) < 2){ echo "<div align=\"center\" style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding: 5px;\">[b]There are no comments for this entry yet.[/b]</div>"; }

4. Now save the file and upload to your server or wateva.

Note: You can edit the style of the DIV Tag to your needs.

Name: message when article has no comments
Author: Jetski
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Like the title says.
Instructions:
1. Open up shows.inc.php in the inc folder of cutenews for editing and find:

//----------------------------------
// Prepare the Comment Pagination
//----------------------------------

$prev_next_msg = $template_comments_prev_next;

3. Above the code shown above paste in the code below

if(count($individual_comments) < 2){ echo "<div align=\"center\" style=\"border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding: 5px;\">[b]There are no comments for this entry yet.[/b]</div>"; }

4. Now save the file and upload to your server or wateva.

Note: You can edit the style of the DIV Tag to your needs.

Sort of like a "news last updated" kind of thing?

It can be easily done smile

<?php
echo "Page Last Updated on: " . date("F d Y H:i:s.", filemtime('path/to/cutenews/data/news.txt')); 
?>

Change path/to/cutenews/data/ to where your cutenews data folder resides.

Example: if you installed cutenews on www.yoursite.com/cutenews/

You would do:

<?php
echo "Page Last Updated on: " . date("F d Y H:i:s.", filemtime('cutenews/data/news.txt')); 
?>

The date() function(s) can be found on http://uk2.php.net/date/

Name: Count all articles in a Category
Author: John/Will
CuteNews Compatibility: 1.3.6 - 1.4.1
Description:
Do you want a way to show your users how many articles you have in a single or multiple categories ? Thought it was impossible? NOT ANYMORE!
Instructions:

Post this at the place where you want the output to appear on your site

<?php
$active_news = file('news/data/news.txt');
$counts = array();
foreach ($active_news as $newsRaw) {
$newsProperties = explode('|', $newsRaw);
$counts[$newsProperties[6]] += 1;
}
<---OUTPUTCODE GOES HERE--->
?>


Now we'll actually show our article count
Replace

<---OUTPUTCODE GOES HERE--->


For multiple categories:

echo ''.($counts[xxx] + $counts[xxx]).' articles present';


For single categories:

echo ''.$counts[xxx].' articles present';

Now to dissect the code (My favourite part, drools)

$active_news = file('news/data/news.txt');


This tells you the directory your cutenews is (news) the data folder (data) and the news.txt file.... all this line does is read.
Be sure that path to CuteNews is correct!.

all you need to do, on both the accounts above, is replace "xxx" with the category(ies) numbers of your choice that you want the articles to count.

So for example.......If using the multiple category hack..... You choose:

Category 1 and Category 5.

Category 1 has 4 articles in it
Category 5 has 2 articles in it

The final value will be 6 articles present because the script counts 4+2=6.

For the single category, it counts articles for that category ONLY.

Strangely enough I have that same print code! .... Never used it like that before, I would just make a print.css file and change the link rel to media="print" ... so my websites print button uses that stylesheet smile

PM me the details? .... I'm a nosey fecker and I want to know as MUCH about cutenews and what you have done to it as possible NyNe smile

Cheers bud!

ORIGINAL POST FOR MORE INFORMATION!!!


What the hack is:
This hack allows you to put "page-specific" data on a page that utilizes CuteNews  :blink:.  Let me elaborate:

Do you want to display something like an introduction to your site on your main page and then your CuteNews data below it?  In a normal scenario, your main site (for our purposes it will be called 'index.php', would look something like this:

<html>
<body>
  Hello World!  Welcome to my website, index.php!
  This is a really dumb intro, so to put you out of your misery,
  here is some news:
  


  <?php include("cutenewsdirectory/show_news.php"); ?>
  

  

  Thanks for reading my news!  Bye!
</body>
</html>


When you actually looked at that page in a browser, it would look something like:

index.php wrote:

Hello World!  Welcome to my website, index.php!  This is a really dumb intro, so to put you out of your misery, here is some news:


Babies overtake Germany
This just in.  It looks as though Germany has been over-run by a group of wild babies.  They appear to be showing no mercy, eating anything and everything in their path - leaving a trail of death and fecal matter in their wake.
Read More - Comments (1337)

-------------------

Missy Elliott is officially the coolest person in the world
God just declared Missy Elliott to be the coolest person in the world.  He was too tied up to comment - he muttered something about babies and Germany before shuffling off, but he made it very clear that Missy Elliott was the coolest person in the world.
Read More - Comments (666)

Thanks for reading my news!  Bye!

So far so good, right?  Right!  Until you click 'Read More'.  Let's click on it:

index.php?subaction=showfull&id=1103068371&archive=&start_from=&ucat=& wrote:

Hello World!  Welcome to my website, index.php!  This is a really dumb intro, so to put you out of your misery, here is some news:


Babies overtake Germany
This just in.  It looks as though Germany has been over-run by a group of wild babies.  They appear to be showing no mercy, eating anything and everything in their path - leaving a trail of death and fecal matter in their wake.  I suppose I should say more since this is the 'full article'.  Apparently the babies are heading towards the ocean where they have hired terrorists to build them small aircrafts so that they can traverse the globe, causing havoc everywhere.  They plan on utilizing chemical warfare from their aircrafts, dropping toxic material including dirty diapers, breastmilk, and urine.  Counties all around the world are trying to group all nannies so they can try to get these brutal babies under control.  Authorities are saying to flee if any babies flying aircrafts are near.  More updates to come.

comments:

#1337 - Poster #1 is an idiot.

[posters #2-#1336]

#1 - Wow babies are teh l33t babbzorrz, but whie dunt tey dr0p teh crunk juice!1!11!1

post your comment:
Name: |_________|
Website/Email: |___________|
Comment: |_______________|                       Remember Me? |/|
[Submit] [Clear]

Thanks for reading my news!  Bye!

As you can see - before the article starts, it says: "Hello World!  Welcome to my website, index.php!  This is a really dumb intro, so to put you out of your misery, here is some news:" when that should only be displayed on the main page, 'index.php'.

So that is what this hack does.  It lets you put something only on the main page.

How Does it Work?

You add this script to the main page, wherever you want to include the page-specific content.  What the script does is request the visitor's URL from the server, and then it checks whether the url is the main page or not.  If it is the main page then it displays the page-specific data.  If it is not the right page, then it just displays the news.

Okay, sounds good, but now I need the code.

Well, if you insist:

<?PHP
$urssss = $_SERVER["REQUEST_URI"];    /* This code requests the current URL of the visitor from the                                                        server and stores it in the variable $urssss.
                                          Feel free to change variable names. */

if($urssss == "/" or $urssss== "/index.php")   /* This code checks to see if the visitor is on the main
                                                  page.  If they are on the main page then it executes
                                                  the following code: */
    {
    echo "This is the page-specific content.  This can include HTML, so feel free to. [b]Welcome to my website![/b] [i]Blah blah blah blah blah[/i]";
    } ?>

So you paste that code wherever you want the page-specific content.

Let's apply that code to our example.

Hey, I was thinking the same thing!  Okay, our original example webpage would look like this with the hack in operation:

<html>
<body>
  <?PHP
    $urssss = $_SERVER["REQUEST_URI"];    /* This code requests the current URL of the visitor from the                                                        server and stores it in the variable $urssss.
                                          Feel free to change variable names. */

if($urssss == "/" or $urssss== "/index.php")   /* This code checks to see if the visitor is on the main
                                                  page.  If they are on the main page then it executes
                                                  the following code: */
    {
    echo "Hello World!  Welcome to my website, index.php!
  This is a really dumb intro, so to put you out of your misery,
  here is some news:";
    } ?>
  


  <?php include("cutenewsdirectory/show_news.php"); ?>
  

  


 if($urssss == "/" or $urssss== "/index.php")   /* This code checks to see if the visitor is on the main
                                                  page.  If they are on the main page then it executes
                                                  the following code: */
    {
    echo " Thanks for reading my news!  Bye!";
    } ?>
</body>
</html>

And that would make the text only appear on your home page, assuming your home page is index.php.  If it is not, then change the if statement to be:

 if($urssss == "/" or $urssss== "/whateveryourpageiscalled.php") 

Is there anywhere that I can see this hack being implemented?

Why, yes!  I didn't make it for no reason.  I am using it on my website, EmoOnline.com:

If you go to the main page and look, you will see that I have an introduction, saying what the site is about.

Then go to this example article and you will notice that there is no introduction in front of the article.

This hack could have a million different uses, so don't hesitate to use it.

If you have any questions, PM me. smile

EmoOnline

Name: "Sticky" Top Article
Author: EmoOnline
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Ever wanted to have one news post or article above all of the rest? ... Well ... This code below is the static version (aka you need to update via files not through cutenews!)
note: simpler alternative available here: Having Pinned/Important posts
In the next topic we'll discuss how to have 1 specific article on a page.
Instructions:
This hack exists in changing the CN Inlcude code, no CuteNews files need to be edited.

<?PHP
   $sticky = $_SERVER["REQUEST_URI"];
   if($sticky == "/" or $sticky== "/index.php")
   {
   echo "Some Text here

";
   }
   /* And the following code is just the regular show news stuff. */
   $number = "5";
   include("cutenews/show_news.php");
   ?>

Ok the above shows "Some Text here" on your website and below this will show 5 news articles from your cutenews installation.  Once you click on "read more" or "comment" the "Some Text Here" text will disappear.  How does this work?

   $sticky = $_SERVER["REQUEST_URI"];
Checks the referral, which, should be your homepage... forget about this, its important so dont change it https://cutephp.com/forum/style_emoticons/default/tongue.gif

   if($sticky == "/" or $sticky== "/index.php")
This is the part you can choose to change.  The script gets the referral information from the line above.....checks it against your site and index.php (as above) and if your site has www.mysite.com/index.php or www.mysite.com then it will display the "some text here".

If your site is www.mysite.com/about.php it will not display "some text here" it is ONLY for the "RooT" of your website and the index.php page (which, you can change yourself).


<?PHP
   $sticky = $_SERVER["REQUEST_URI"];
   if($sticky == "/" or $sticky== "/index.php")
   {
$number="1";
$subaction="showfull";
$id="xxx"; // the id of the sticky article
$template="xxx";
$category="xxx";
include("news/show_news.php");
   }

   $number = "5";
   include("cutenews/show_news.php");
   ?>

Ok the above seems complicated....but lets break it down.....


$number="1";
shows one post....the sticky article

$subaction="showfull";
only for cutenews 1.x.x

$id="xxx";
The news id (very important) .... write a news article, add it, post it.....Now go to "edit news" and hover your mouse over the title or click on it...See the long number digit? .... its usually about 11 characters long (not hard to miss) . write that in place of the "xxx".

$template="xxx";
Make a template (if you want) and include it where the "xxx" is.

$category="xxx";
Make a category (if you want) and include it where the "xxx" is.

include("news/show_news.php");
The main include, essential.

With all the above correctly done, you can manage your new sticky topic through cutenews instead of it being static !! https://cutephp.com/forum/style_emoticons/default/smile.gif

Talk about sluggish bandwidth....I'm waiting 4 minutes already and the sites not even halfway loaded....i'll edit this post when the site loads - Just thought I'd let you know that tongue

working example:
http://www.planet-megaman.com/search.php

The working example is cutenews 1.3.6 - The code BELOW is for Aj-Fork v.167/168

open search.php

find TWICE:

"user",


add after BOTH:

 "category",

find:

// Show Search Form


add above:

// Define Categories
$cat_lines = file("$cutepath/data/category.db.php");
foreach($cat_lines as $single_line){
        $cat_arr = explode("|", $single_line);
    $cat[$cat_arr[0]] = $cat_arr[1];
    $cat_icon[$cat_arr[0]]=$cat_arr[2];
}

find:

  <tr>
    <td width="100%" align="right">Author <input type=text value="$user" name=user size="24">
  </tr>


add below:

<!-- search cats -->
HTML;
    if(count($cat_lines) > 0){
  echo"<tr>
  <td width=\"100%\" align=\"right\">
  Category 
  <select name=category>\n
  <option value=\"\" selected>- All -</option>\n";
        foreach($cat_lines as $single_line){
        $cat_arr = explode("|", $single_line);
        if (strlen($cat_arr[1]) > 17) { $cat_arr['disp'] = substr($cat_arr[1], 0, 17 - 3) . '...'; }
          else { $cat_arr['disp'] = $cat_arr[1]; }
              echo"<option value=\"$cat_arr[0]\">$cat_arr[disp]</option>\n";
    }
     echo"</select></tr>";
    }
echo <<<HTML
<!-- search cats -->

find:

$found  = 0;


add below:

$fcat   = FALSE;

find:

if($story and (@preg_match("/$story/i", "$news_db_arr[4]") or @preg_match("/$story/i", "$news_db_arr[3]"))){ $fstory = TRUE;}


add below:

if($category == $news_db_arr[6]){ $fcat = TRUE;}

find:

if($user  and $fuser) { $fuser  = TRUE; }elseif(!$user) { $fuser  = TRUE; }else{ $fuser  = FALSE; }


add below:

if($category  and $fcat) { $fcat  = TRUE; }elseif(!$category) { $fcat  = TRUE; }else{ $fcat  = FALSE; }

find:

$fdate and $ftitle and $fuser and $fstory


add after:

 and $fcat

find:

                                   if($local_id == $news_id){
////////// Showing Result

                    echo"
[b][url=]$item_arr[2][/url][/b] (". date("d F, Y", $item_arr[0]) .")";

////////// End Showing Result
                }


replace with:

// search cats
if($category == $item_arr[6] || !isset($category)){
    if($local_id == $news_id){ echo"
[b][url=]$item_arr[2][/url][/b] (". date("d F, Y", $item_arr[0]) .")"; }
}
// show cats

The only differences between this and the original post that NyNe made is that this one works specifically ONLY for AJ-Fork by using the aj_go=more instead of subaction=showfull - Hope that helps some of you Forkers! big_smile

All well and good for cutenews 1.3.6 but aj-fork uses a different method to show news as full yikes .... i'll do a variation of this for the fork... smile

check out http://www.cutephp.com/cutenews/addons/ for some hacks for cutenews 1.3.6 (some for aj-fork) and also http://willyps.com/willyps/files/cutenews/ for some more hacks.

I think the wordfilter is at willyps.

hey guys.....worry about it when the time comes alright? .. you've done great work so far in making a convertor NyNe .... glad you actually did that so people have the choice to switch to cutenews without their news being deleted so BIG BIG up to you man smile

When fusion 3.7/4.0 comes out.......don't fret, relax....you'll find a way to decode it to cutenews if people decide to use cutenews as their management tool WHICH I THINK PERSONALLY they should big_smile

21

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

Name: News Last Updated
Author: JubbaG
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: This will put some text with some date on your site so people can see when you last made a update.
Instructions:

Put somewhere on your site.

<?php echo "Page Last Updated on: " . date("F d Y H:i:s.", filemtime('path/to/cutenews/data/news.txt')); ?>


and replace path/to/cutenews/

Need this deciphered?
GLADLY!

we'll focus on the date() function ONLY the rest should be self-explanitory.

F = Date in long function (January, February, March etc)
d = Day of month with leading 0 (01 03 09 12 19 21 etc)
Y = Full representation of Year (1986, 1999, 2001, 2005 etc)
H = 24 hour format with leading 0 (01, 09, 13, 18, 23 etc)
i = Minutes (same as above)
s = Seconds (same as above)

If you need some info on changing the above visit this site:

PHP DOT NET Date functions below:
http://uk.php.net/manual/en/function.date.php

22

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

Name: Display a User List
Author: JubbaG & DaForce & RDF
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Show a list of users on your site.
Instructions:
Don't forget to modify the path To CuteNews if needed.

<?php
//CHANGE PATH//
$file = file("cutenews/data/users.db.php");
/////////////////////
foreach ($file as $line)
{
if(eregi("</?",$line)) continue;
$array = explode("|",$line); //$array[0] contains date joined, 1 = level, 2 = name, 3 = password hash, 4 = nickname, 5 = email, 6 = posts
        switch($array[1]){
        case 1: $array[1] = "Administrator"; break;
        case 2: $array[1] = "Editor"; break;
        case 3: $array[1] = "Journalist"; break;
        case 4: $array[1] = "Commenter"; break;
        }
echo '<table width="800" border="1" cellspacing="0" cellpadding="0"><tr style="text-align:center;"><td width="200">';
//This is where we output username
echo $array[4];
echo '</td><td width="200">';
echo $array[1];
echo '</td><td width="200">';
echo $array[5];
echo '</td><td width="200">';
echo $array[6];
echo '</td></tr></table>';
}
?>

Possibly, although, when the admin section is complete people will NEED to learn CSS before they can tackle changing it, due to the fact its such an extensive tool and INCREDIBLY time saving smile

No problem @ The replies mate.  I prefer to give people a lot of information rather than a little...unless its a question thats been answered hundreds of times, then I give them a link to a corresponding post in the forum tongue

smile

1. Cutenews has visitor stats.. stating how many articles you currently have, how many archives, comments, users... etc ... So much to choose from.  This is available as a seperate file on http://www.cutephp.com/cutenews/addons/

2. Scheduled posting is also referred as "Prospective Posting" which I and eruin have both slaved over hammer and tongs, him coding, me testing, and he has a system in Aj-Fork that can handle if you make a news post on monday for example, it won't appear on the website until Thursday at 6pm ... smile so its already in cutenews, but the Fork.

3. A new image manager is in place in AJ-Fork allowing greater use of the program, you can create directories, paths, you can even EDIT the image online! Minor adjustments like size, ratio, filesize etc...quality.

4. Dont like the idea of this tongue

5. When eruin has 168 up he has customised "some" of it to be expandable with CSS, soon it will be 100% or close to that mark.  Depends on what the future holds mate.

*for more addons.. http://willyps.com/willyps/files/cutenews/

Depends what functions, I could perhaps nibble on your soul if you use the functions... tongue nothing serious lol