Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Mon Aug 29, 2005 6:21 am Reply with quote

The current block displays every newsletter - unfortunately this also include 'unassigned' and 'test' newsletters.
How would I alter the sql call in the block so that only those categories with a value greater than (whatever the curent maximum default value) can be shown in the block?
 
View user's profile Send private message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Mon Aug 29, 2005 6:34 am Reply with quote

Oops, I should read the readme!
The unassigned newsletters are only displayed in the block if you are logged in as an admin.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Aug 29, 2005 9:35 am Reply with quote

Guardian wrote:
Oops, I should read the readme!
The unassigned newsletters are only displayed in the block if you are logged in as an admin.


Yes, that is correct. The thought there is that as admin, you would possibly want to see that there are newsletters which have been set to "**Unassigned**", which can happen when Categories are deleted.

However, if you would like to keep the two what I would call "System Newsletters", you could do so as follows:

** Find within block-HTML_Newsletter.php Script this code:

Code:

/* Get Newsletter List and build the block content */

if ($showcategories == 1) {  //Build SQL for displaying categories
   $sql = "SELECT nid, nl.cid, topic, sender, datesent, view, groups, hits, ctitle, cblocklimit  FROM ".$prefix."_hnl_newsletters as nl, ".$prefix."_hnl_categories nc WHERE nl.cid = nc.cid ORDER BY ctitle ASC, datesent DESC";
} else {  //Build SQL for displaying just date sorted list of newsletters
   $sql = "SELECT nid, nl.cid, topic, sender, datesent, view, groups, hits, ctitle, cblocklimit  FROM ".$prefix."_hnl_newsletters as nl, ".$prefix."_hnl_categories nc WHERE nl.cid = nc.cid ORDER BY datesent DESC";
}


And change it to:

Code:

/* Get Newsletter List and build the block content */

if ($showcategories == 1) {  //Build SQL for displaying categories
   $sql = "SELECT nid, nl.cid, topic, sender, datesent, view, groups, hits, ctitle, cblocklimit  FROM ".$prefix."_hnl_newsletters as nl, ".$prefix."_hnl_categories nc WHERE nl.cid = nc.cid AND nid > 2 ORDER BY ctitle ASC, datesent DESC";
} else {  //Build SQL for displaying just date sorted list of newsletters
   $sql = "SELECT nid, nl.cid, topic, sender, datesent, view, groups, hits, ctitle, cblocklimit  FROM ".$prefix."_hnl_newsletters as nl, ".$prefix."_hnl_categories nc WHERE nl.cid = nc.cid AND nid > 2 ORDER BY datesent DESC";
}


This will just exclude the first to nid's from the returned list of newsletters in the block. This will NOT change the module display of newsletters. You could find the corresponding query within index.php if you are interested.

Regards,
montego

_________________
“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
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Tue Aug 30, 2005 8:56 pm Reply with quote

Thank you.
 
View user's profile Send private message
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