Datalife Engine 9.2 lastnews.php problem... please help me!

Discussion in 'PHP' started by bersy, Apr 23, 2011.

  1. #1
    my last news module working good but the category not appear in the links
    ex : http://www.shiftwap.com/0/95662-christmas-cupid-2010-dvdrip-xvid-rosub.html
    Im using the Datalife Engine script 9.2, can someone help me fix this issue?

    <?php
    /*
    =====================================================
     ?î??ëü ?ë? DataLife Engine - by BDSoft
    -----------------------------------------------------
     email: bdsoft@mail.com  site: www.myws.ru
    -----------------------------------------------------
     Copyright (c) 2007 bdsoft
    =====================================================
     ?à??ûé êî? çàùèù?? àâ?î??êè?è ï?àâà?è
    =====================================================
     ?àéë: lastnews.php
    -----------------------------------------------------
     ?àç?à÷??è?: ?î?ë???è? ?îâî??è v 2.1
    =====================================================
    */
    if(!defined('DATALIFEENGINE'))
    {
      die("Hacking attempt!");
    }
    /*===========================================
                      ?????????
    =============================================*/
    $lastnewsconf['news'] = 200; // ?ëè?à ?îâî??è
    $lastnewsconf['link'] = 30; // ????çà?è? ?è?ëà ?îâî???é
    $lastnewsconf['limit'] = 30; // ?îëè÷???âî ?îâî???é
    $lastnewsconf['hide_html'] = true;// ????à?ü â?? ???è èç ??ê??à ?îâî??è (true - ?à, false - ???)
    $lastnewsconf['only_hide_main'] = false;// ?îêàçûâà?ü ?îëüêî ?îâî??è ?? îï??ëèêîâà?û? ?à ?ëàâ?îé (true - ?à, false - ???)
    $lastnewsconf['category'] = '1,2,3,4,5,6,7,8,9'; // ?îêàçûâà?ü êà???î?èè, ï???÷è?ëè?? ID êà???î?èé ÷???ç çàï???? ??ç ï?î??ëîâ. ??ëè ????î ïîêàçâà?ü â?? î??àâ?? ïîë? ï???û?
    
    $lastnews = dle_cache("lastnews", $config['skin']);
    
    if (!$lastnews) {
    //include(ENGINE_DIR.'/inc/parse.class.php');
    //$parse = new ParseFilter(Array(), Array());
    
    if ($lastnewsconf['only_hide_main'])
       $ln_allow_main = 'and allow_main=0';
    else
       $ln_allow_main = '';
    
    if ($lastnewsconf['category'])
       $ln_category = 'and category = '. str_replace(',',' or ', $lastnewsconf['category']);
    else
       $ln_category = '';
    $tpl->load_template('lastnews.tpl');
            $db->query("SELECT id, title, short_story , date, alt_name FROM ". PREFIX . "_post WHERE approve='1' $ln_allow_main $ln_category ORDER BY date DESC LIMIT 0,{$lastnewsconf['limit']}");
    
            while($row = $db->get_row()){
    
            $row['date'] = strtotime($row['date']);
    
            if (strlen($row['title']) > $lastnewsconf['link'])
            $title = substr ($row['title'], 0, $lastnewsconf['link'])." ..";
            else
            $title = $row['title'];
    
            //$row['short_story'] =  preg_replace("/\[attachment=[[:digit:]]*\]/si","",stripslashes($parse->BB_Parse($parse->process($row['short_story']))));
            $row['short_story'] =  preg_replace("/\[attachment=[[:digit:]]*\]/si","",stripslashes($row['short_story']));
            $row['short_story'] =  preg_replace("/<!--*-->/si","",$row['short_story']);
    	if($lastnewsconf['hide_html'])$row['short_story'] = strip_tags($row['short_story']);
    
    
    	if (strlen($row['short_story']) > $lastnewsconf['news'])
            $short_story = substr ($row['short_story'], 0, $lastnewsconf['news'])." ...";
            else
            $short_story = $row['short_story'];
            
    	$go_page = ($config['ajax']) ? "onclick=\"DlePage('newsid=".$row['id']."'); return false;\" " : "";
    
            if ($config['allow_alt_url'] == "yes")
            $tpl->set_block("'\[full-link\](.*?)\[/full-link\]'si", "<a {$go_page}href=\"".$config['http_home_url'].$row['category'] = intval( $row['category'] )."/".$row['id']."-".$row['alt_name'].".html\">\\1</a>");
            	else 
            $tpl->set_block("'\[full-link\](.*?)\[/full-link\]'si", "<a {$go_page}href=\"$PHP_SELF?newsid=".$row['id']."\">\\1</a>");
    
    
            $tpl->set('{title}', stripslashes($title));
    	$tpl->set('{short_news}', $short_story);
    
    	$tpl->compile('lastnews');
    
    		}
    $lastnews = $tpl->result['lastnews'];
    }
    
    ?>
    PHP:
     
    bersy, Apr 23, 2011 IP
  2. bersy

    bersy Greenhorn

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    please any one help me!
     
    bersy, Apr 24, 2011 IP
  3. clonepal

    clonepal Active Member

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    Code looks ok, check your .htaccess file from your server.

    -clonepal
     
    clonepal, Apr 24, 2011 IP
  4. bebygirl

    bebygirl Member

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    contact the developer support and u will get replay quickly!
     
    bebygirl, Apr 24, 2011 IP
  5. tbenmcp

    tbenmcp Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think your issue in one how to set your SEO url in your Admin CP, if you set your site seo to type 2, then your link should include the category in url but if you set it to type 1 which I think what you are setting on your site right now...so try to change the seo type to type 2, should work fine on your module
     
    tbenmcp, Oct 30, 2011 IP