| Author |
Message |
Kenny
Newbie


Joined: Sep 04, 2007
Posts: 16
|
Posted:
Tue Sep 04, 2007 5:16 pm |
|
Is there any way to get help with this to NSN News  |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Tue Sep 04, 2007 10:06 pm |
|
Sure, post the relevant tables that are a part of the module and what you would like to see in the titles and I can give this a shot. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Wed Sep 05, 2007 8:02 pm |
|
Kenny, I have unbanned you...
When you post PHP code, try it without the PHP tags.
However, I had asked for the table structures, not the PHP code. I am assuming there is going to be some table to hold the categories and another for the actual news articles, let us start with that. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Wed Sep 05, 2007 10:19 pm |
|
Actually, I've been looking at the code that was blocked by NukeSentinel and it looks like the tables might be the same ones as the core nuke was using.
So, what specifically, is not working for you? Can you compare it with what I have running here on my site (the page titles for news) and tell me what is different?
Thanks. |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Kenny
Newbie


Joined: Sep 04, 2007
Posts: 16
|
Posted:
Sun Sep 09, 2007 7:00 am |
|
It will not show anythinh exept for the module name and thanks for the unban stupid me
I'm currently running Jonathan Estrellas dynamic titles but that one doesent show a snippet from the news only the headlines etc so here is the code that he uses
| Code: |
// News
if($mod_title=="News"){
global $file,$sid,$new_topic,$op;
if (!empty($custom_name)) {
$mod_title = $custom_name;
}
$newpagetitle= "$item_delim $mod_title";
if ($new_topic!=""){
$sql = "SELECT topictext FROM ".$prefix."_topics WHERE topicid='$new_topic'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$topic = $row[topictext];
$newpagetitle= "$item_delim $topic";
}
if ($file=="article" || $op=="NEArticle"){
$sql = "SELECT title, topic FROM ".$prefix."_stories WHERE sid='$sid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$art = $row[title];
$topic = $row[topic];
$sql = "SELECT topictext FROM ".$prefix."_topics WHERE topicid='$topic'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$topic = $row[topictext];
$newpagetitle= "$item_delim $mod_title $item_delim $art";
}
}
|
|
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Sun Sep 09, 2007 10:38 am |
|
Yes, I deleted my post. Having a bad day.
Try this:
=== OPEN ===
includes/dynamic_titles.php
=== FIND CODE ===
| Code: |
// News
elseif ($name == 'News') {
global $file, $sid, $new_topic;
if ($new_topic != '') {
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($new_topic).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $row['topictext'].$dt_delim.$sitename;
} elseif ($file == 'article') {
$sql = 'SELECT title, topic, hometext FROM '.$prefix.'_stories WHERE sid=\''.intval($sid).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
$asDTText['text'] = substr($row['hometext'], 0, $text_size);
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($row['topic']).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $asDTText['subject'].$dt_delim.$asDTText['text'].$dt_delim.$row['topictext'];
}
}
|
=== REPLACE WITH ===
| Code: |
// News
elseif ($name == 'News') {
global $file, $sid, $new_topic;
if ($new_topic != '') {
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($new_topic).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $row['topictext'].$dt_delim.$sitename;
} elseif ($file == 'article' || $op == 'NEArticle') {
$sql = 'SELECT title, topic, hometext FROM '.$prefix.'_stories WHERE sid=\''.intval($sid).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
$asDTText['text'] = substr($row['hometext'], 0, $text_size);
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($row['topic']).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $asDTText['subject'].$dt_delim.$asDTText['text'].$dt_delim.$row['topictext'];
}
}
|
NOTE: This is for TegoNuke(tm) Dynamic Titles version 1.1.0 ONLY! |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Kenny
Newbie


Joined: Sep 04, 2007
Posts: 16
|
Posted:
Sun Sep 09, 2007 12:03 pm |
|
It's the same and yeah I use TegoNuke(tm) Dynamic Titles version 1.1.0 when I tested it |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Sun Sep 09, 2007 12:21 pm |
|
Ok, I'm confused. Was Jonathan Estrellas' code working for you, but mine posted about does not?
I don't use NSN News. Can you post (or PM) me a link to your site so that I can see what is being used in the URL for that module because I assumed that NEArticle was what was being used based on the code you posted. |
| |
|
|
 |
Kenny
Newbie


Joined: Sep 04, 2007
Posts: 16
|
Posted:
Fri Sep 28, 2007 8:27 am |
|
Sorry for the delay benn busy ,a good friend of mine ( Ahmad Faisal " PHP Nuke Indonesia )helped me out with this,so here it is
| Code: |
// News
elseif ($name == 'News') {
global $op, $sid, $new_topic, $year, $thismonth, $month;
if ($new_topic != '') {
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($new_topic).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $sitename.$dt_delim.$dt_mod_name.$dt_delim."Topic ".$row['topictext'];
} elseif ($op == 'NEArticle') {
$sql = 'SELECT title, topic, hometext FROM '.$prefix.'_stories WHERE sid=\''.intval($sid).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$asDTText['subject'] = $row['title'];
$asDTText['text'] = substr($row['hometext'], 0, $text_size);
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($row['topic']).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $dt_mod_name.$dt_delim.$asDTText['subject'].$dt_delim.$asDTText['text'].$dt_delim.$row['topictext'];
// Stories Archive
} elseif ($op == 'NEArchive') {
$newpagetitle = $sitename.$dt_delim.'Stories Archive';
} elseif ($op == 'NEMonth') {
$newpagetitle = $sitename.$dt_delim.'Stories Archive'.$dt_delim.$month.', '.$year;
// Topics
} elseif ($op == 'NETopicMain') {
$newpagetitle = $sitename.$dt_delim.'Active Topics';
}
}
|
|
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Fri Sep 28, 2007 8:30 am |
|
This will definitely help others too. Thank you! |
_________________ “To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins |
|
|
 |
Kenny
Newbie


Joined: Sep 04, 2007
Posts: 16
|
Posted:
Tue Nov 27, 2007 4:00 pm |
|
There are some changes to this with your latest version,so here you go,but there are some work left for the topics etc but the main NE News is working with this one
| Code: |
// News
elseif ($name == 'News') {
global $op, $sid, $new_topic, $year, $thismonth, $month;
if ($new_topic != '') {
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($new_topic).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $sitename.$dt_delim.$dt_mod_name.$dt_delim."Topic ".$row['topictext'];
} elseif ($op == 'NEArticle') {
$sql = 'SELECT title, topic, hometext FROM '.$prefix.'_stories WHERE sid=\''.intval($sid).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
//$text_size);
$asDTText['text'] = substr($row['hometext'], 0, $text_size);
$asDTText['subject'] = $row['title'];
$asDTText['text'] = $row['hometext'];
$asDTText['bodytext'] = $row['bodytext'];
$sql = 'SELECT topictext FROM '.$prefix.'_topics WHERE topicid=\''.intval($row['topic']).'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$newpagetitle = $asDTText['subject'] . $dt_sDelim . $asDTText['text'] . ' ' . $asDTText['bodytext'] . $dt_sDelim . $row['topictext'];
// Stories Archive
} elseif ($op == 'NEArchive') {
$newpagetitle = $sitename.$dt_delim.'Stories Archive';
} elseif ($op == 'NEMonth') {
$newpagetitle = $sitename.$dt_delim.'Stories Archive'.$dt_delim.$month.', '.$year;
// Topics
} elseif ($op == 'NETopicMain') {
$newpagetitle = $sitename.$dt_delim.'Active Topics';
}
}
|
|
Last edited by Kenny on Tue Dec 18, 2007 1:30 pm; edited 1 time in total |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 946
|
Posted:
Wed Nov 28, 2007 7:39 am |
|
|
|
 |
|
|