<?php
/**
* This file is part of
* pragmaMx - Web Content Management System.
* Copyright by pragmaMx Developer Team - http://www.pragmamx.org
*
* pragmaMx is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* --------------------------------------------------------------------
* JNews 1.0 for pragmaMx 0.1.10
* written by (c) 2009 Mustafa Navruz, http://www.navruz.net
* based on pragmamx news block and Azer Koculu's news block (http://azer.kodfabrik.com)
* --------------------------------------------------------------------
**/
$thisfile = basename(__FILE__);
defined('mxMainFileLoaded') or die('access denied');
//Ayarlar - Settings//
//Gösterilecek Haber - Show limit
$limit = 11;
//Saydamlık değeri - Set opacity
$opacity = "0.4";
//Varsayılan haber fotoğrafı - Default news image
$blank_image = "media/images/blank_news.jpg";
$mxblockcache = true;
global $prefix;
if ($GLOBALS["multilingual"] == 1) {
if (ereg("german", $GLOBALS["currentlang"])) $thislang = "german";
else $thislang = $GLOBALS["currentlang"];
$querylang = " WHERE (alanguage LIKE '$thislang%' OR alanguage='') AND `time` <= now()";
} else {
$querylang = "WHERE `time` <= now()";
}
$content = "";
$count = 0;
$result = sql_query("select sid, title, hometext from ${prefix}_stories $querylang ORDER BY `time` DESC, `sid` DESC limit 0,$limit");
if (!$result || sql_num_rows($result) < 1) {
return;
}
while (list($sid, $title, $hometext) = sql_fetch_row($result)) {
preg_match('#<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1#im', $hometext, $image);
if (is_array($image) && !empty($image)) {
if(substr($image[2],0,7)!='http://') {
$image = $image[2];
}
} else {
$image = MX_BASE_URL.$blank_image;
}
$search = array("\n", "\r", " ","'","\"");
$replace = array("", "", " ","&#39;","&#34;");
$introtext = mxCutString(trim(str_replace($search,$replace,strip_tags($hometext))), 150, "...", " ");
$titlek = str_replace($search,$replace,mxCutString(trim($title), 28, "...", " "));
if($count == 0){
$content.='<div id="newsblock">
<div id="newsphoto" class="newsh"><img id="newsimg" class="newsimage" src="'.$image.'" alt=""/>
<div id="newsop"></div><div id="newsall"><a id="newslink" href="#">'.$titlek.'</a><span id="newsdesc">'.$introtext.'</span></div></div>';
}
$content.="\n";
$content.='<a id="news'.$count.'" class="news" href="modules.php?name=News&file=article&sid='.$sid.'" onmouseover="changethis(\''.$count.'\',\''.addslashes(htmlspecialchars($titlek)).'\',\''.$image.'\',\''.addslashes(htmlspecialchars($introtext)).'\');"> &#8250; '.$title.'</a><img style="display:none;" src="'.$image.'" alt="'.$titlek.'"/>';
$count++;
}
$content.='</div><div class="clear"></div>';
//js code for opacity
$content.='<script type="text/javascript">
var newsop = document.getElementById("newsop");
newsop.style.opacity = "'.$opacity.'";
newsop.style.filter = "alpha(opacity='.$opacity * 100 .')";
</script>';
//add javascript
pmxHeader::add('<script type="text/javascript">
function changethis(e,s,r,t){
var newsblock = document.getElementById("newslink");
var newblock = document.getElementById("news" + e);
var newsphoto = document.getElementById("newsimg").src;
var newsdesc = document.getElementById("newsdesc");
if(e){
newsdesc.innerHTML = t ;
newsblock.innerHTML = s;
document.getElementById("newsimg").src = r;
} }</script>');
//add style
pmxHeader::add('
<style type="text/css">
#newsblock { width:100%; height:180px; padding:0px;}
#newsblock .news { display:block; color:#777; font:12px "Trebuchet MS", "MS Sans Serif", georgia; text-decoration:none;text-align:left;}
#newsblock .news:hover { color:#111; }
#newsblock .newsh { float:left; width:300px; height:210px; margin-right:5px; display:inline; }
#newsblock .newsimage { width: 300px;height:200px;position: absolute;z-index: 90;margin:0;padding:0;overflow:hidden;}
#newsblock #newsall { margin-top:135px; padding:5px; position:absolute; z-index:99; display:block; width:270px; text-decoration:none; font:12px "Trebuchet MS", "MS Sans Serif", georgia; color:#ccc; line-height:13px; }
#newsblock #newsall a{ display:block; font:21px "Arial Narrow", Arial, Tahoma; letter-spacing:-1px; padding:0; margin:0; color:#eee;text-decoration:none; }
#newsblock #newsall span {display:block; text-decoration:none; font:12px "Trebuchet MS", "MS Sans Serif", georgia; color:#ccc; line-height:13px; }
#newsblock #newsall span:hover { color:#fff; }
#newsblock #newsop { margin:120px 0 0 0px; position:absolute; z-index:95; display:block; width:270px; height:75px; background:#000; /*opacity:0.4; filter:alpha(opacity=40); */}
</style>');
?>
Jnews Haber Bloğunun Kodları , Resimler'de Sorun Yaşıyorum CDMOOD Ayarları Forumda Daha önce verilmiş olan konulardaki ayarlar ile aynı ayarlda bir sorun yok resim değişkenini neden tanımıyor yardımcı olabilirmisiniz ?
Elinde Sorunsuz Haber bloğu olan arkadaşlar paylaşabilirmi veya ? teşekkürker