[Cutenews] Kleine dingetjes aanpassen.

Status
Niet open voor verdere reacties.

karimbizid

Gebruiker
Lid geworden
19 dec 2006
Berichten
557
Hallo allemaal,

Wil Cutenews nu eindelijk is gaan gebruiken.
Alleen heb ik een klein vastlopertje...
Onder mijn bericht staat:
"Posted on 11 Jun 2007 by Karim"

Dat wil ik een beetje aanpassen naar de nederlandse taal.


Het zou toch in show_news.php moeten staan (de pagina die ik ook include in mijn pagina)...

PHP:
<?PHP

error_reporting (E_ALL ^ E_NOTICE);

$cutepath =  __FILE__;
$cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath);
$cutepath = preg_replace( "'/show_news\.php'", "", $cutepath);

require_once("$cutepath/inc/functions.inc.php");
require_once("$cutepath/data/config.php");

// If we are showing RSS, include some need variables.
if($template == 'rss'){
   include("$cutepath/data/rss_config.php");
}

//----------------------------------
// Check if we are included by PATH
//----------------------------------
if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
elseif(eregi("show_news.php", $PHP_SELF)){
die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br>
This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br>
this is <font color=red>WRONG</font> :&nbsp;&nbsp; &lt;?PHP include(\"http://yoursite.com/cutenews/show_news.php\"); ?&gt;<br>
this is <font color=green>CORRECT</font>:&nbsp;&nbsp; &lt;?PHP include(\"cutenews/show_news.php\"); ?&gt;<br>
<br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>");
}
//----------------------------------
// End of the check
//----------------------------------

if(!isset($subaction) or $subaction == ""){ $subaction = $POST["subaction"]; }

if(!isset($template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); }
else{
        if(file_exists("$cutepath/data/${template}.tpl")){ require("$cutepath/data/${template}.tpl"); }
    else{ die("Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is"); }
}

// Prepare requested categories
if(eregi("[a-z]", $category)){
        die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"".htmlspecialchars($category)."\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br>
    example:<br><blockquote>&lt;?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\");<br>?&gt;</blockquote>");
}
$category = preg_replace("/ /", "", $category);
$tmp_cats_arr = explode(",", $category);
foreach($tmp_cats_arr as $key=>$value){
    if($value != ""){ $requested_cats[$value] = TRUE; }
}

if($archive == ""){
        $news_file = "$cutepath/data/news.txt";
        $comm_file = "$cutepath/data/comments.txt";
}else{
        $news_file = "$cutepath/data/archives/$archive.news.arch";
        $comm_file = "$cutepath/data/archives/$archive.comments.arch";
}

$allow_add_comment                        = FALSE;
$allow_full_story                        = FALSE;
$allow_active_news                         = FALSE;
$allow_comments                         = FALSE;



//<<<------------ Detarime what user want to do
if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($requested_cats[$ucat] == TRUE )  ) ){
    if($subaction == "addcomment"){  $allow_add_comment        = TRUE; $allow_comments = TRUE; }
    if($subaction == "showcomments"){ $allow_comments = TRUE; }
    if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; }
    if($subaction == "showfull") $allow_full_story = TRUE;
    if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE;

}
else{
    if($config_reverse_active == "yes"){ $reverse = TRUE; }
        $allow_active_news = TRUE;
}
//----------->>> Detarime what user want to do

require("$cutepath/inc/shows.inc.php");
    if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ?
unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives);
?>

Alvast bedankt,

Karim
 
Laatst bewerkt:
Je kunt ook kijken wat er ge-include wordt...

Even in de map data het bestand default.tpl openen en naar regel 11 kijken :)
 
Daar ben ik nog een keer...

Ik zie het vaker gebeuren op site's dat je bij de comments op nieuwsberichten ook hun avatar e.d. krijgt te zien.
Ik wil dit ook in mijn nieuws pagina, maar het probleem is dat ik al een heel membersysteem heb.

Cutenews loopt nu op users.db (apart bestand in de map).
Is het mogelijk om gewoon dezelfde personen (en hun gegevens) te gebruiken in cutenews?
Kan ik Cutenews dus koppelen aan m'n MySQL database?
En hoe laat ik dan die avatars zien bij hun comments?

Alvast bedankt:thumb:,
Karim
 
Is het mogelijk om gewoon dezelfde personen (en hun gegevens) te gebruiken in cutenews?
Alles is mogelijk, moet je er wel op letten dat je dezelfde format aanhoudt als in users.db

Kan ik Cutenews dus koppelen aan m'n MySQL database?
Kan wel, moet je wel op de implementatie letten zodat het juist wordt weergegeven.

En hoe laat ik dan die avatars zien bij hun comments?
Een extra veld in de database maken waarin je de url naar de avatar plaatst.

Verder moet je dan waarschijnlijk het gebruikerspanel (als die er is) aanpassen zodat men met een uploadscript een eigen avatar kan uploaden...
 
Het werk heeft even een tijdje stil gelegen :p ...

Ik ben denk ik niet ervaren genoeg om deze klus te klaren :eek:
Zouden jullie mij een beetje op weg willen helpen?

Op deze manier staan de users in het bestand users.db:
Code:
1181553865|1|admin|1c1ea1e0a9b50cf0991a35bb9d56a148|Karim|karim@seriousmusic.nl|1|0||1181633205||

Ik neem aan dat ik een sructuur aan moet gaan maken in een my-sql tabel,
maar wat voor strucuur?

Ook moet ik waarschijnlijk wat regels aanpassen in alle pagina's, want het nieuws systeem zet alles in users.db en leest alles ook uit users.db.

Alvast bedankt voor de hulp :thumb:,
Karim
 
Waarschijnlijk staat er ergens in het cutenews script de functie
PHP:
explode($variabele, '|');

Aangezien de verschillende gegevens zijn gesplitst door een |

Daar moet je dus wijzigingen in aanbrengen...

De structuur is niet moeilijk, je kijkt gewoon welk deel waar voor staat en daar maak je een veld voor in je database...

Het zal wel iets zoals onderstaand zijn...
Code:
Registratie-datum in UNIX formaat | GebruikersID | Username | Password | Real Name | Email | Rechten | Posts | Laatste login
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan