mariovaldez.net

MV.net forums
It is currently 14 Jul 2016, 00:32

All times are UTC - 7 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: cm_lib.inc.php
PostPosted: 31 Jul 2003, 10:24 
Hi Mario! :D
Here is an edited & tested version of cm_lib.inc.php that I made some bug fixes (had to change <= to <, try using zero in maxleafs & you'll see what I mean :wink: ) and enhancements to.

Enhancements:
Text display scenerios.
Experation date for Special announces that last 1 1/2 times the length of a normal article ( other wise people might leave them enabled for ever & it would still show up ).

Code:
<?php
// Altered by Mark Coudriet
include_once ($path_pre . "cm/cm_lib.inc.php");
if (!$tdwidth) { $cm_tdwidth = (600 + 12); } else { $cm_tdwidth = (($tdwidth * 2) + 12); }
if ($tr_hover) { $cm_hover = $terminfarbe; } else { $cm_hover = ""; }
echo "<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\"><tr><td>";
$result2 = db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_type from content3 where cmdb_parentdir like '/%' and cmdb_type like '%" . CM_HITTYPE_ANNOUNCE . "%' " . fcm_access_sqldef ($user_kurz) . " order by cmdb_date_update desc") or db_die();
if ( $result2 ) echo "<b>New Announcements</b>";
while ($row2 = db_fetch_row($result2)) {
   // Give Special Announces an experation date
   if (fcm_diffdate_days ($row2[4]) < ($cm_sum_oldestleafallowed * 1.5)) {
      fcm_articlelist_nostyle ($row2[1], $row2[0], $row2[3], $row2[4], fcm_is_cleditable ($row2[1], $user_kurz, $row2[5]), true, $cm_tdwidth, $terminfarbe, "");
      $trip_flag = 1;
   }
}
if (!$trip_flag) { echo "<br>No new announcements.."; }
else $trip_flag = "";
echo "</td></tr></table>";
echo "<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\"><tr><td>";
$cm_rowcolor = $bgcolor1;
$result2 = "";
$result2 = db_query("select cmdb_title, cmdb_directory, cmdb_parentdir, cmdb_abstract, cmdb_date_update, cmdb_type from content3 where cmdb_directory like '/%' and cmdb_type like '%" . CM_HITTYPE_PAGE . "%' and cmdb_type not like '%" . CM_HITTYPE_ANNOUNCE . "%' " . fcm_access_sqldef ($user_kurz) . " order by cmdb_date_update desc") or db_die();
if ( $result2 ) echo "<b>New Articles</b>";
while ($row2 = db_fetch_row($result2)) {
  if (fcm_diffdate_days ($row2[4]) < $cm_sum_oldestleafallowed) {
    fcm_articlelist_nostyle ($row2[1], $row2[0], $row2[3], $row2[4], fcm_is_cleditable ($row2[1], $user_kurz, $row2[5]), false, $cm_tdwidth, $cm_rowcolor, $cm_hover);
   $trip_flag = 1;
    if ($cm_rowcolor == $bgcolor1) { $cm_rowcolor = $bgcolor2; } else { $cm_rowcolor = $bgcolor1; }
  }
}
if (!$trip_flag) { echo "<br>No new articles..."; }
echo "</td></tr></table>";
?>


Best Regards,

Mark Coudriet


Report this post
Top
  
Reply with quote  
 Post subject: MORE
PostPosted: 31 Jul 2003, 17:09 
Line 35 & 50 added visual indication to users about displayed content.
Code:
if ( $result2 ) echo "<b>New Announcements</b> <i>(Last ". ($cm_sum_oldestleafallowed * 1.5) ." days)</i>";

if ( $result2 ) echo "<b>New Articles</b> <i>(Last ". $cm_sum_oldestleafallowed ." days)</i>";


Best Regards,
Mark Coudriet


Report this post
Top
  
Reply with quote  
PostPosted: 15 Jun 2004, 02:59 
Instead of using this:
Code:
$result2 = db_query ("select ID, kurz from users where kurz = '$cm_username'") or db_die();


It must be:
Code:
$result2 = db_query ("select ID, kurz from ".DB_PREFIX."users where kurz = '$cm_username'") or db_die();

(Only for PHProjekt DB tTable use!)


Report this post
Top
  
Reply with quote  
 Post subject: DB Prefix
PostPosted: 15 Jun 2004, 11:24 
User avatar

Joined: 06 Mar 2003, 03:21
Posts: 447
Location: Monterrey, NL, Mexico
Guest:

Hi. Thanks for the report. The Phprojekt DB prefix has been integrated in the CMS module since version 0.6.0 b12. If you are using the CMS module with Phprojekt and a DB prefix, please upgrade.

It should work even if your Phprojekt tables use the prefix and your CMS tables don't. :wink:

Regards,

Mario A. Valdez-Ramirez


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 7 hours


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group