Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
djw2
Regular
Regular



Joined: Sep 19, 2003
Posts: 95
Location: St. Louis, MO

PostPosted: Sun Apr 25, 2004 12:56 pm Reply with quote

Hey there,

I'm running a PHP Nuke 7.1 and I'm trying to figure out where $title is pulled from.

Currently my headlines look like this...

Quote:
Politics: Diebold Machine May Get Boot


I want to remove the politics category from the title. The theme I'm using shows the category at the bottom like this...

Quote:
(Read More... | 1 comment | | Politics | Score: 0)


I'm guessing it pulling from the mainfile.php but I've been over it a couple a times and I can't identify it. If someone could give me some direction I sure would appreciate it.


Thanks tons,

Dan
 
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
bones
Hangin' Around



Joined: Sep 18, 2003
Posts: 36

PostPosted: Sun Apr 25, 2004 1:48 pm Reply with quote

depending on your theme, it should be in the header.html or the theme.php file.
 
View user's profile Send private message Visit poster's website
djw2







PostPosted: Sun Apr 25, 2004 1:58 pm Reply with quote

Well, theme.php calls $title... but from where?

Here look...

Quote:
function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
global $tipath, $anonymous, $bgcolor1, $bgcolor2, $bgcolor3;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
$t_image = "themes/$ThemeSel/images/topics/$topicimage";
} else {
$t_image = "$tipath$topicimage";
}
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" bgcolor=$bgcolor3 width=\"100%\"><tr><td>"
."<table border=\"0\" cellpadding=\"5\" cellspacing=\"1\" width=\"100%\"><tr><td bgcolor=$bgcolor2>"
."<font class=\"storytitle\">$title</font><br>"
."<font size=\"1\">"
."$time <br>Posted&nbsp;"._BY." "
."<b>";
formatAidHeader($aid);
echo "</b> ($counter "._READS.")</font></td></tr>"
."<tr><td bgcolor=$bgcolor1><a href=\"modules.php?name=News&amp;new_topic=$topic\"><img src=\"$t_image\" align=\"right\" border=\"0\" alt=\"$topictext\" title=\"$topictext\"></a>";
FormatStory($thetext, $notes, $aid, $informant);
echo "<br>"
."</td></tr><tr><td bgcolor=$bgcolor1 align=\"right\">"
."<font size=\"2\">$morelink</font>"
."</td></tr></table></td></tr></table>"
."<br>";
}


That one command ($title) calls both the category and the title to the story. I want to modify this command to where it merely pulls the title without the category... because the category displays at the bottom of the story.

Thanks again,

Dan
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Apr 25, 2004 2:07 pm Reply with quote

What theme are you using and can we have a link to your site so I can visualize this? Thanks.
 
View user's profile Send private message
djw2







PostPosted: Sun Apr 25, 2004 2:49 pm Reply with quote

Oh sure... sorry about that.
[ Only registered users can see links on this board! Get registered or login! ]

The theme is called Newspaper. It's an older theme but I've had no technical problems with it. I figure I may be lucking out because the theme is so plain and basic... I don't know honestly. Chatserv is the one that told me it's an old theme. Works well though.

Anyway, notice the categories are listed at both the top and the bottom of the stories.

The top one is nested in the $title command and the bottom on is nested in the $morelink command.


Peace!

Dan
 
Raven







PostPosted: Sun Apr 25, 2004 3:42 pm Reply with quote

Find where themeindex is called. That is where $title gets passed. Check later in theme.php and mainfile.php. And I think it's the topic that is appended, not a category.
 
djw2







PostPosted: Sun Apr 25, 2004 6:39 pm Reply with quote

Raven wrote:
Find where themeindex is called. That is where $title gets passed. Check later in theme.php and mainfile.php. And I think it's the topic that is appended, not a category.



Hey Raven,

I'm sorry but I'm not sure I understand. The thing I'm looking for is the catid in the nuke_stories table of the database... I think.

I'm not sure it can be removed.

Thanks though.
 
Raven







PostPosted: Sun Apr 25, 2004 6:42 pm Reply with quote

Regardless, do you have a utility that can search all your files for themeindex( ? That should show you how it gets assigned.
 
djw2







PostPosted: Sun Apr 25, 2004 7:22 pm Reply with quote

No I don't... I don't think.

I use phpEdit to edit my files.

I've never even looked for a search feature.


Thanks Raven.

Dan
 
Raven







PostPosted: Sun Apr 25, 2004 8:04 pm Reply with quote

I will assume you have a backup copy of the files on your PC. Just use the windoze Search Files on the folder containing your files.
 
Nukeum66
Life Cycles Becoming CPU Cycles



Joined: Jul 30, 2003
Posts: 551
Location: Neurotic, State, USA

PostPosted: Sun Apr 25, 2004 10:51 pm Reply with quote

You need to edit modules/news/categories.php
Note: This code is from Patched 7.2 so yours may be a bit different
On or about line:95 look for this code
Code:
$row2 = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_stories_cat where catid='$catid'"));


comment out this line like so:
Code:
/*$row2 = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_stories_cat where catid='$catid'"));*/



Then on or about line : 98 remove the : from here
Quote:
$title = "$title1: $title";


so it looks like this:
Quote:
$title = "$title1 $title";


That's it!
Thank you for stopping by and Please Come Again! Laughing

_________________
Scott Johnson MIS Ubuntu/Linux 11.10 
View user's profile Send private message Visit poster's website
djw2







PostPosted: Mon Apr 26, 2004 7:46 am Reply with quote

Hey Nukeum,

Thanks a lot man... we're so close. Smile

Here's the deal, I have a pretty hacked up news module. It's the old New2 mod that splits the news into two columns.

Anyway, I've made a couple changes and I have removed the category prefix from all the articles. However, when viewed in the index (home), or in the topics view the prefix is still present.

I'm posting the categories.php below and I'll make the changes I made bold. See if you can identify the additional changes needed.

Thanks again, I really appreciate it.

Quote:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* [ Only registered users can see links on this board! Get registered or login! ] */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

$index = 1;
$categories = 1;
$cat = $catid;
automated_news();

function theindex($catid) {
global $storyhome, $httpref, $httprefmax, $topicname, $topicimage, $topictext, $datetime, $user, $cookie, $nukeurl, $prefix, $multilingual, $currentlang, $db, $articlecomm, $module_name;
if ($multilingual == 1) {
$querylang = "AND (alanguage='$currentlang' OR alanguage='')"; /* the OR is needed to display stories who are posted to ALL languages */
} else {
$querylang = "";
}
include("header.php");
if (isset($cookie[3])) {
$storynum = $cookie[3];
} else {
$storynum = $storyhome;
}
/*$db->sql_query("update ".$prefix."_stories_cat set counter=counter+1 where catid='$catid'");*/
$sql = "SELECT sid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories where catid='$catid' $querylang ORDER BY sid DESC limit $storynum";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)){
$s_sid = $row[sid];
$aid = $row[aid];
$title = $row[title];
$time = $row[time];
$hometext = $row[hometext];
$bodytext = $row[bodytext];
$comments = $row[comments];
$counter = $row[counter];
$topic = $row[topic];
$informant = $row[informant];
$notes = $row[notes];
$acomm = $row[acomm];
$score = $row[score];
$ratings = $row[ratings];
getTopics($s_sid);
formatTimestamp($time);
$subject = stripslashes($subject);
$hometext = stripslashes($hometext);
$notes = stripslashes($notes);
$introcount = strlen($hometext);
$fullcount = strlen($bodytext);
$totalcount = $introcount + $fullcount;
$c_count = $comments;
$r_options = "";
if (isset($cookie[4])) { $r_options .= "&amp;mode=$cookie[4]"; }
if (isset($cookie[5])) { $r_options .= "&amp;order=$cookie[5]"; }
if (isset($cookie[6])) { $r_options .= "&amp;thold=$cookie[6]"; }
if (is_user($user)) {
$the_icons = " | <a href=\"modules.php?name=News&amp;file=print&amp;sid=$s_sid\"><img src=\"images/print.gif\" border=\"0\" alt=\""._PRINTER."\" title=\""._PRINTER."\" width=\"16\" height=\"11\"></a>&nbsp;&nbsp;<a href=\"modules.php?name=News&amp;file=friend&amp;op=FriendSend&amp;sid=$s_sid\"><img src=\"images/friend.gif\" border=\"0\" alt=\""._FRIEND."\" title=\""._FRIEND."\" width=\"16\" height=\"11\"></a>";
} else {
$the_icons = "";
}
$story_link = "<a href=\"modules.php?name=News&amp;file=article&amp;sid=$s_sid$r_options\">";
$morelink = "(";
if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) {
$morelink .= "$story_link<b>"._READMORE."</b></a> | ";
} else {
$morelink .= "";
}
if ($fullcount > 0) { $morelink .= "$totalcount "._BYTESMORE." | "; }
if ($articlecomm == 1 AND $acomm == 0) {
if ($c_count == 0) { $morelink .= "$story_link"._COMMENTSQ."</a>"; } elseif ($c_count == 1) { $morelink .= "$story_link$c_count "._COMMENT."</a>"; } elseif ($c_count > 1) { $morelink .= "$story_link$c_count "._COMMENTS."</a>"; }
}
$morelink .= "$the_icons";
if ($score != 0) {
$rated = substr($score / $ratings, 0, 4);
} else {
$rated = 0;
}
$morelink .= " | "._SCORE." $rated";
$morelink .= ")";
$morelink = str_replace(" | | ", " | ", $morelink);
$sid = $s_sid;
$sql2 = "select title from ".$prefix."_stories_cat where catid='$catid'";
$result2 = $db->sql_query($sql2);
/*$row2 = $db->sql_fetchrow($result2);*/
$title1 = $row2[title];

$title = "$title1 $title";
themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext);
}
if ($httpref==1) {
$referer = $_SERVER["HTTP_REFERER"];
if ($referer=="" OR ereg("unknown", $referer) OR eregi($nukeurl,$referer)) {
} else {
$db->sql_query("insert into ".$prefix."_referer values (NULL, '$referer')");
}
$numrows = $db->sql_numrows($db->sql_query("select * from ".$prefix."_referer"));
if($numrows==$httprefmax) {
$db->sql_query("delete from ".$prefix."_referer");
}
}
include("footer.php");
}

switch ($op) {

case "newindex":
if ($catid == 0 OR $catid == "") {
Header("Location: modules.php?name=$module_name");
}
theindex($catid);
break;

default:
Header("Location: modules.php?name=$module_name");

}

?>
 
Raven







PostPosted: Mon Apr 26, 2004 8:43 am Reply with quote

Try commenting out this line

$title = "$title1 $title";
 
Nukeum66







PostPosted: Mon Apr 26, 2004 9:51 am Reply with quote

Just the first one
Quote:
$title = "$title1 $title";
 
djw2







PostPosted: Mon Apr 26, 2004 9:54 am Reply with quote

Hey,

Thanks so much you guys for pointing me in the right direction.

That last suggested change didn't do it Raven... not completely anyway, but this whole process got me looking in the right area. I've been spending all my time in the core files... (like the mainfile.php and in the database stuff). It turned out to be much easier than I thought it would be.

*What worked...

I found this in the includes/theindex.php (remember, this is a news module hack, the actual line is most likely in the modules/News/index.php but I'm not sure).

Code:
$title = "<a href=\"modules.php?name=News&amp;file=categories&amp;op=newindex&amp;catid=$catid\"><font class=\"storycat\">$title1</font></a>: $title";


I changed it to this...

Code:
$title = "$title";



Then in the modules/News/article.php file...

I found this...

Code:
if ($catid != 0) {

    $sql = "select title from ".$prefix."_stories_cat where catid='$catid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $title1 = $row[title];
    $title = "<a href=\"modules.php?name=$module_name&file=categories&op=newindex&catid=$catid\"><font class=\"storycat\">$title1</font></a>: $title";
}



I had to comment out the title line...

Code:
if ($catid != 0) {

    $sql = "select title from ".$prefix."_stories_cat where catid='$catid'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $title1 = $row[title];
    /*$title = "<a href=\"modules.php?name=$module_name&file=categories&op=newindex&catid=$catid\"><font class=\"storycat\">$title1</font></a>: $title";*/
}



So, in the end the three changes all together delivered my desired results.


Thanks again for all your help guys. I would have given up on this long ago without you.


Peace!

Dan
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©