Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Kenny
Newbie
Newbie



Joined: Sep 04, 2007
Posts: 24

PostPosted: Tue Sep 04, 2007 5:16 pm Reply with quote

Is there any way to get help with this to NSN News Rolling Eyes
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Sep 04, 2007 10:06 pm Reply with quote

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 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Sep 05, 2007 8:02 pm Reply with quote

Kenny, I have unbanned you... Wink

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 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Sep 05, 2007 10:19 pm Reply with quote

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 
View user's profile Send private message Visit poster's website
Kenny
Newbie
Newbie



Joined: Sep 04, 2007
Posts: 24

PostPosted: Sun Sep 09, 2007 7:00 am Reply with quote

It will not show anythinh exept for the module name Wink and thanks for the unban stupid me Embarassed

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";
   }
}
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Sep 09, 2007 10:38 am Reply with quote

Yes, I deleted my post. Having a bad day. Sad

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 
View user's profile Send private message Visit poster's website
Kenny
Newbie
Newbie



Joined: Sep 04, 2007
Posts: 24

PostPosted: Sun Sep 09, 2007 12:03 pm Reply with quote

It's the same Crying or Very sad and yeah I use TegoNuke(tm) Dynamic Titles version 1.1.0 when I tested it
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Sep 09, 2007 12:21 pm Reply with quote

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.
 
View user's profile Send private message Visit poster's website
Kenny
Newbie
Newbie



Joined: Sep 04, 2007
Posts: 24

PostPosted: Fri Sep 28, 2007 8:27 am Reply with quote

Sorry for the delay benn busy Wink ,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';
   }
}
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Sep 28, 2007 8:30 am Reply with quote

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 
View user's profile Send private message Visit poster's website
Kenny
Newbie
Newbie



Joined: Sep 04, 2007
Posts: 24

PostPosted: Tue Nov 27, 2007 4:00 pm Reply with quote

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 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Nov 28, 2007 7:39 am Reply with quote

Thanks again!
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch