Moved the Agents into their own repo. Kept the agent.pl just for reference
This commit is contained in:
parent
22381be29a
commit
8680a02b13
18132 changed files with 0 additions and 2569420 deletions
|
|
@ -1,244 +0,0 @@
|
|||
<?php
|
||||
// News Lister, http://www.netartmedia.net/newslister
|
||||
// A software product of NetArt Media, All Rights Reserved
|
||||
// Find out more about our products and services on:
|
||||
// http://www.netartmedia.net
|
||||
// Released under the MIT license
|
||||
if(!defined('IN_SCRIPT_ADMIN')) {
|
||||
global $db;
|
||||
echo '<h3>'.get_lang('no_access').'</h3>';
|
||||
$abuse_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
$db->logger(get_lang('unauthorized_access').' '.$abuse_link);
|
||||
}
|
||||
else{
|
||||
?>
|
||||
<h2><?php echo get_lang('add_new_listing');?></h2>
|
||||
<div class="news-row goback"><a href="home.php?m=news&p=admin_news" class="news-btn news-btn-default pull-right"><?php echo get_lang('go_back');?></a></div>
|
||||
<div class="news-container">
|
||||
<?php
|
||||
$show_add_form=true;
|
||||
|
||||
class SimpleXMLExtended extends SimpleXMLElement
|
||||
{
|
||||
public function addChildWithCDATA($name, $value = NULL) {
|
||||
$new_child = $this->addChild($name);
|
||||
|
||||
if ($new_child !== NULL) {
|
||||
$node = dom_import_simplexml($new_child);
|
||||
$no = $node->ownerDocument;
|
||||
$node->appendChild($no->createCDATASection($value));
|
||||
}
|
||||
|
||||
return $new_child;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_REQUEST["proceed_save"]))
|
||||
{
|
||||
///server side check if fields are not empty in case user modified the page with 'inspect element' to remove required option
|
||||
$fields_ok=true;
|
||||
if (empty(trim($_POST["title"]," "))) {
|
||||
echo "<h3><span class='failure'>".get_lang('empty_title')."</span></h3>";
|
||||
$fields_ok=false;
|
||||
}
|
||||
if (empty(trim(strip_tags($_POST["description"]),"/ / "))) {
|
||||
echo "<h3><span class='failure'>".get_lang('empty_description')."</span></h3>";
|
||||
$fields_ok=false;
|
||||
}
|
||||
if (empty(trim($_POST["written_by"]," "))) {
|
||||
echo "<h3><span class='failure'>".get_lang('empty_author')."</span></h3>";
|
||||
$fields_ok=false;
|
||||
}
|
||||
if ($fields_ok) {
|
||||
///images processing
|
||||
$str_images_list = "";
|
||||
$limit_pictures=25;
|
||||
$path="modules/news/";
|
||||
$ini_array = parse_ini_file("modules/news/config.php",true);
|
||||
$image_quality=$ini_array["website"]["image_quality"];
|
||||
$max_image_width=$ini_array["website"]["max_image_width"];
|
||||
|
||||
include("modules/news/include/images_processing.php");
|
||||
///end images processing
|
||||
$listings = simplexml_load_file($this->data_file,'SimpleXMLExtended', LIBXML_NOCDATA);
|
||||
$listing = $listings->addChild('listing');
|
||||
$listing->addChild('time', time());
|
||||
$listing->addChild('title', stripslashes($_POST["title"]));
|
||||
$article_content=stripslashes(str_replace('\r\n', '',$_POST["description"]));
|
||||
$article_content=str_replace(" "," ",$article_content);
|
||||
|
||||
$listing->addChildWithCDATA('description', $article_content);
|
||||
$listing->addChild('images', $str_images_list);
|
||||
$listing->addChild('written_by', stripslashes($_POST["written_by"]));
|
||||
$listings->asXML($this->data_file);
|
||||
?>
|
||||
<h3><?php echo get_lang('new_added_success');?></h3>
|
||||
<br/>
|
||||
<a href="home.php?m=news&p=admin_news&page=add" class="underline-link"><?php echo get_lang('add_another');?></a>
|
||||
<?php echo get_lang('or_message');?>
|
||||
<a href="home.php?m=news&p=admin_news&page=home" class="underline-link"><?php echo get_lang('manage_listings');?></a>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<?php
|
||||
$show_add_form=false;
|
||||
}
|
||||
}
|
||||
|
||||
if($show_add_form)
|
||||
{
|
||||
?>
|
||||
<br/>
|
||||
|
||||
<?php
|
||||
if($this->settings["website"]["WYSIWYG"]=="TinyMCE") { ?>
|
||||
<script src="modules/news/js/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
tinymce.init({
|
||||
selector: '#description',
|
||||
inline: true,
|
||||
menubar: false,
|
||||
skin_url: 'modules/news/js/tinymce/skins/<?php echo $this->settings["website"]["tinymce_skin"]; ?>',
|
||||
language: '<?php echo $this->settings["website"]["tinymce_lang"]; ?>',
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
||||
'searchreplace wordcount visualblocks visualchars code fullscreen',
|
||||
'insertdatetime media nonbreaking save table contextmenu directionality',
|
||||
'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help'
|
||||
],
|
||||
toolbar1: 'undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image media | link unlink | removeformat',
|
||||
toolbar2: 'styleselect | fontselect forecolor backcolor fontsizeselect | code',
|
||||
image_advtab: true
|
||||
});
|
||||
</script>
|
||||
<?php } else if($this->settings["website"]["WYSIWYG"]=="NicEdit") { ?>
|
||||
<script src="modules/news/js/nicEdit.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
bkLib.onDomLoaded(function() {
|
||||
new nicEditor({fullPanel : true,iconsPath : 'modules/news/js/nicEditorIcons.gif'}).panelInstance('description');
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<form action="home.php?m=news&p=admin_news" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="page" value="add"/>
|
||||
<input type="hidden" name="proceed_save" value="1"/>
|
||||
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('title');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
<input class="news-form-control" type="text" name="title" required value="<?php echo $_REQUEST["title"];?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('description');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
<?php
|
||||
if($this->settings["website"]["WYSIWYG"]=="TinyMCE") { ?>
|
||||
<div id="description" class="news-form-control news-form-control-mce"></div>
|
||||
<?php }
|
||||
if($this->settings["website"]["WYSIWYG"]=="NicEdit") { ?>
|
||||
<textarea class="news-form-control news-form-control-mce" id="description" name="description" cols="40" rows="10"><?php echo $_POST["description"];?></textarea>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('images');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
<?php if (extension_loaded('gd')) { ?>
|
||||
<!--images upload-->
|
||||
<script src="modules/news/js/jquery.uploadfile.js"></script>
|
||||
|
||||
|
||||
<div id="mulitplefileuploader"><?php echo get_lang('please_select');?></div>
|
||||
|
||||
|
||||
<div id="status"><i>
|
||||
|
||||
</i>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var uploaded_files="";
|
||||
$(document).ready(function()
|
||||
{
|
||||
var settings = {
|
||||
url: "modules/news/upload.php",
|
||||
dragDrop:true,
|
||||
fileName: "myfile",
|
||||
maxFileCount:25,
|
||||
allowedTypes:"jpg,png,gif",
|
||||
returnType:"json",
|
||||
onSuccess:function(files,data,xhr)
|
||||
{
|
||||
if(uploaded_files!="") uploaded_files+=",";
|
||||
uploaded_files+=data;
|
||||
|
||||
},
|
||||
afterUploadAll:function()
|
||||
{
|
||||
var preview_code="";
|
||||
var imgs = uploaded_files.split(",")
|
||||
for (var i = 0; i < imgs.length; i++)
|
||||
{
|
||||
preview_code+='<div class="img-wrap"><img width="120" src="modules/news/uploads/'+imgs[i]+'"/></div>';
|
||||
}
|
||||
|
||||
document.getElementById("status").innerHTML=preview_code;
|
||||
document.getElementById("list_images").value=uploaded_files;
|
||||
},
|
||||
showDelete:false,
|
||||
|
||||
showProgress:true,
|
||||
showFileCounter:false,
|
||||
showDone:false
|
||||
}
|
||||
|
||||
|
||||
|
||||
var uploadObj = $("#mulitplefileuploader").uploadFile(settings);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--end images upload-->
|
||||
<?php
|
||||
}else{
|
||||
echo "<h3><span class='failure'>".get_lang('gd_fail')."</span></h3>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('written_by');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
<input class="news-form-control" type="text" name="written_by" required value="<?php echo isset($_REQUEST["written_by"]) ? $_REQUEST["written_by"] : $_SESSION['users_login']; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="list_images" value="<?php if(isset($_POST["list_images"])) echo $_POST["list_images"];?>" id="list_images"/>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br/>
|
||||
<button type="submit" class="news-btn news-btn-default pull-right"> <?php echo get_lang('submit');?> </button>
|
||||
<div class="clearfix"></div>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
<?php
|
||||
// News Lister
|
||||
// Copyright (c) All Rights Reserved, NetArt Media 2003-2016
|
||||
// Check http://www.netartmedia.net/newslister for demos and information
|
||||
// Released under the MIT license
|
||||
if(!defined('IN_SCRIPT')) die("");
|
||||
if (!empty($_SESSION['user_id'])) {$homex="home";} else {$homex="index";}
|
||||
if(isset($_REQUEST["id"]) && $_REQUEST["id"]!="" && is_numeric($_REQUEST["id"])) {
|
||||
$id=intval($_REQUEST["id"]);
|
||||
$listings = simplexml_load_file($this->data_file);
|
||||
if (isset($listings->listing[$id])) { ?>
|
||||
<h2><?php echo strip_tags(html_entity_decode($listings->listing[$id]->title));?></h2>
|
||||
<div class="news-row">
|
||||
<div class="news-row">
|
||||
<br>
|
||||
<?php if($listings->listing[$id]->images!="" && $this->settings["website"]["images_bottom"]==0) { /// showing the listing images for right side setting
|
||||
echo'<div class="news-one-third pull-right">';
|
||||
$images=explode(",",trim($listings->listing[$id]->images,","));
|
||||
if(file_exists("modules/news/uploaded_images/".$images[0].".jpg")) {
|
||||
echo "<a href=\"modules/news/uploaded_images/".$images[0].".jpg\" rel=\"prettyPhoto[ad_gal]\">";
|
||||
echo "<img src=\"modules/news/uploaded_images/".$images[0].".jpg\" alt=\"".strip_tags(html_entity_decode($listings->listing[$id]->title))."\" class=\"final-image\"/>";
|
||||
echo "</a>";
|
||||
} ?>
|
||||
<br/><br/>
|
||||
<?php for($i=1;$i<sizeof($images);$i++) {
|
||||
if(trim($images[$i])=="") continue;
|
||||
if($i!=0) {
|
||||
echo "<a href=\"modules/news/uploaded_images/".$images[$i].".jpg\" rel=\"prettyPhoto[ad_gal]\">";
|
||||
}
|
||||
echo "<img class=\"thumbnail-detail\" src=\"modules/news/thumbnails/".$images[$i].".jpg\" width=\"85\" alt=\"\"/>";
|
||||
if($i!=0) {
|
||||
echo "</a>";
|
||||
}
|
||||
} ?>
|
||||
<link rel="stylesheet" href="modules/news/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
|
||||
<script src="modules/news/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function() {
|
||||
$("a[rel='prettyPhoto[ad_gal]']").prettyPhoto({
|
||||
<?php if($this->settings["website"]["gallery_theme"]!='default') { ?>theme: '<?php echo $this->settings["website"]["gallery_theme"]; ?>' <?php } ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php
|
||||
/// end showing the listing images if right side setting
|
||||
}
|
||||
if($this->settings["website"]["safe_HTML"]==1) {
|
||||
require_once('modules/news/include/library/HTMLPurifier.auto.php');
|
||||
$purificateur = new HTMLPurifier();
|
||||
echo $purificateur->purify($listings->listing[$id]->description);
|
||||
} else {
|
||||
echo $listings->listing[$id]->description;
|
||||
}
|
||||
if($listings->listing[$id]->images!="" && $this->settings["website"]["images_bottom"]==1) { /// showing the listing images for bottom setting
|
||||
echo'<div class="news-row img-bottom">';
|
||||
$images=explode(",",trim($listings->listing[$id]->images,","));
|
||||
if(file_exists("modules/news/uploaded_images/".$images[0].".jpg")) {
|
||||
echo "<a href=\"modules/news/uploaded_images/".$images[0].".jpg\" rel=\"prettyPhoto[ad_gal]\">";
|
||||
echo "<img src=\"modules/news/uploaded_images/".$images[0].".jpg\" alt=\"".strip_tags(html_entity_decode($listings->listing[$id]->title))."\" class=\"final-image\"/>";
|
||||
echo "</a>";
|
||||
} ?>
|
||||
<br/><br/>
|
||||
<?php for($i=1;$i<sizeof($images);$i++) {
|
||||
if(trim($images[$i])=="") continue;
|
||||
if($i!=0) {
|
||||
echo "<a href=\"modules/news/uploaded_images/".$images[$i].".jpg\" rel=\"prettyPhoto[ad_gal]\">";
|
||||
}
|
||||
echo "<img class=\"thumbnail-detail\" src=\"modules/news/thumbnails/".$images[$i].".jpg\" width=\"85\" alt=\"\"/>";
|
||||
if($i!=0) {
|
||||
echo "</a>";
|
||||
}
|
||||
} ?>
|
||||
<link rel="stylesheet" href="modules/news/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
|
||||
<script src="modules/news/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function() {
|
||||
$("a[rel='prettyPhoto[ad_gal]']").prettyPhoto({
|
||||
<?php if($this->settings["website"]["gallery_theme"]!='default') { ?>theme: '<?php echo $this->settings["website"]["gallery_theme"]; ?>' <?php } ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php
|
||||
/// end showing the listing images if bottom setting
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<div class="news-half pull-left">
|
||||
<br><strong><?php echo date($this->settings["website"]["date_format"],intval($listings->listing[$id]->time));?></strong> - <?php echo get_lang('written_by');?>: <strong><?php echo strip_tags(html_entity_decode(stripslashes($listings->listing[$id]->written_by)));?></strong>
|
||||
</div>
|
||||
<div class="news-half pull-right">
|
||||
<a id="go_back_button" class="news-btn news-btn-default pull-right" href="<?php echo $homex;?>.php?m=news&p=news"><?php echo get_lang('go_back');?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
echo "<h2>".get_lang('latest_news')."</h2><br><h3><span class='failure'>".get_lang('id_invalid')."</span></h3>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<h2>".get_lang('latest_news')."</h2><br><h3><span class='failure'>".get_lang('id_not_set')."</span></h3>";
|
||||
}
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
<?php
|
||||
// News Lister
|
||||
// http://www.netartmedia.net/newslister
|
||||
// Copyright (c) All Rights Reserved NetArt Media
|
||||
// Find out more about our products and services on:
|
||||
// http://www.netartmedia.net
|
||||
// Released under the MIT license
|
||||
if(!defined('IN_SCRIPT_ADMIN')) {
|
||||
global $db;
|
||||
echo '<h3>'.get_lang('no_access').'</h3>';
|
||||
$abuse_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
$db->logger(get_lang('unauthorized_access').' '.$abuse_link);
|
||||
} else{
|
||||
$id=intval($_REQUEST["id"]);
|
||||
$this->ms_i($id);
|
||||
?>
|
||||
<h2><?php echo get_lang('edit_listing');?></h2>
|
||||
<div class="news-row goback"><a href="home.php?m=news&p=admin_news" class="news-btn news-btn-default pull-right"><?php echo get_lang('go_back');?></a></div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
var offsetX = 20;
|
||||
var offsetY = -200;
|
||||
$('a.hover').hover(function(e){
|
||||
var href = $(this).attr('href');
|
||||
$('<img id="largeImage" src="' + href + '" alt="image" />')
|
||||
.css({'top':e.pageY + offsetY,'left':e.pageX + offsetX})
|
||||
.appendTo('body');
|
||||
}, function(){
|
||||
$('#largeImage').remove();
|
||||
});
|
||||
$('a.hover').mousemove(function(e){
|
||||
$('#largeImage').css({'top':e.pageY + offsetY,'left':e.pageX + offsetX});
|
||||
});
|
||||
$('a.hover').click(function(e){
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="news-container">
|
||||
<?php
|
||||
|
||||
$xml = simplexml_load_file($this->data_file);
|
||||
|
||||
|
||||
if(isset($_POST["proceed_save"]))
|
||||
{
|
||||
$article_content=stripslashes(str_replace('\r\n', '',$_POST["description"]));
|
||||
$article_content=str_replace(" "," ",$article_content);
|
||||
|
||||
$xml->listing[$id]->description=$article_content;
|
||||
$xml->listing[$id]->title=stripslashes($_POST["title"]);
|
||||
|
||||
|
||||
if(isset($_POST["written_by"]))
|
||||
{
|
||||
$xml->listing[$id]->written_by=stripslashes($_POST["written_by"]);
|
||||
}
|
||||
|
||||
|
||||
$xml->asXML($this->data_file);
|
||||
echo "<h3>".get_lang('modifications_saved')."</h3><br/>";
|
||||
} ?>
|
||||
|
||||
<br/>
|
||||
<?php
|
||||
if($this->settings["website"]["WYSIWYG"]=="TinyMCE") { ?>
|
||||
<script src="modules/news/js/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
tinymce.init({
|
||||
selector: '#description',
|
||||
inline: true,
|
||||
menubar: false,
|
||||
skin_url: 'modules/news/js/tinymce/skins/<?php echo $this->settings["website"]["tinymce_skin"]; ?>',
|
||||
language: '<?php echo $this->settings["website"]["tinymce_lang"]; ?>',
|
||||
plugins: [
|
||||
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
||||
'searchreplace wordcount visualblocks visualchars code fullscreen',
|
||||
'insertdatetime media nonbreaking save table contextmenu directionality',
|
||||
'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help'
|
||||
],
|
||||
toolbar1: 'undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image media | link unlink | removeformat',
|
||||
toolbar2: 'styleselect | fontselect forecolor backcolor fontsizeselect | code',
|
||||
image_advtab: true
|
||||
});
|
||||
</script>
|
||||
<?php } else if($this->settings["website"]["WYSIWYG"]=="NicEdit") { ?>
|
||||
<script src="modules/news/js/nicEdit.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
bkLib.onDomLoaded(function() {
|
||||
new nicEditor({fullPanel : true,iconsPath : 'modules/news/js/nicEditorIcons.gif'}).panelInstance('description');
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<form action="home.php?m=news&p=admin_news" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="page" value="edit"/>
|
||||
<input type="hidden" name="proceed_save" value="1"/>
|
||||
<input type="hidden" name="id" value="<?php echo $id;?>"/>
|
||||
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('title');?>:
|
||||
</div>
|
||||
|
||||
<div class="eight-tenth pull-right">
|
||||
<input class="news-form-control" type="text" name="title" required value="<?php echo $xml->listing[$id]->title;?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('description');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
<?php
|
||||
if($this->settings["website"]["WYSIWYG"]=="TinyMCE") { ?>
|
||||
<div id="description" class="news-form-control news-form-control-mce"><?php echo $xml->listing[$id]->description;?></div>
|
||||
<?php }
|
||||
if($this->settings["website"]["WYSIWYG"]=="NicEdit") { ?>
|
||||
<textarea class="news-form-control news-form-control-mce" id="description" name="description" cols="40" rows="10"><?php echo $xml->listing[$id]->description;?></textarea>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('images');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
<?php
|
||||
if(trim($xml->listing[$id]->images)!="")
|
||||
{
|
||||
$image_ids = explode(",",trim($xml->listing[$id]->images));
|
||||
|
||||
foreach($image_ids as $image_id)
|
||||
{
|
||||
if(file_exists("modules/news/thumbnails/".$image_id.".jpg"))
|
||||
{
|
||||
echo "<a href=\"modules/news/uploaded_images/".$image_id.".jpg\" class=\"hover\"><img src=\"modules/news/thumbnails/".$image_id.".jpg\" class=\"admin-preview-thumbnail\"/></a>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else { ?>
|
||||
<img src="modules/news/images/no_pic.gif" width="50" class="admin-preview-thumbnail"/>
|
||||
<?php } ?>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<a class="news-btn" href="home.php?m=news&p=admin_news&page=images&id=<?php echo $id;?>"><?php echo get_lang('modify');?></a>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<div class="one-sixth pull-left">
|
||||
<?php echo get_lang('written_by');?>:
|
||||
</div>
|
||||
<div class="eight-tenth pull-right">
|
||||
|
||||
<input class="news-form-control" type="text" name="written_by" value="<?php echo $xml->listing[$id]->written_by;?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<br/>
|
||||
<button type="submit" class="news-btn news-btn-default pull-right"> <?php echo get_lang('save');?> </button>
|
||||
<div class="clearfix"></div>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
<?php
|
||||
// News Lister, http://www.netartmedia.net/newslister
|
||||
// A software product of NetArt Media, All Rights Reserved
|
||||
// Find out more about our products and services on:
|
||||
// http://www.netartmedia.net
|
||||
// Released under the MIT license
|
||||
if(!defined('IN_SCRIPT_ADMIN')) {
|
||||
global $db;
|
||||
echo '<h3>'.get_lang('no_access').'</h3>';
|
||||
$abuse_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
$db->logger(get_lang('unauthorized_access').' '.$abuse_link);
|
||||
}
|
||||
else{
|
||||
|
||||
$ini_array = parse_ini_file("modules/news/config.php",true);
|
||||
|
||||
if(isset($_POST["proceed_delete"])&&trim($_POST["proceed_delete"])!="")
|
||||
{
|
||||
if(isset($_POST["delete_listings"])&&sizeof($_POST["delete_listings"])>0)
|
||||
{
|
||||
$delete_listings=$_POST["delete_listings"];
|
||||
$xml = simplexml_load_file($this->data_file);
|
||||
|
||||
$i=-1;
|
||||
$str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||
<listings>";
|
||||
foreach($xml->children() as $child)
|
||||
{
|
||||
$i++;
|
||||
if(in_array($i, $delete_listings))
|
||||
{
|
||||
continue;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$str = $str.$child->asXML();
|
||||
}
|
||||
}
|
||||
$str = $str."
|
||||
</listings>";
|
||||
|
||||
|
||||
$xml->asXML("modules/news/data/listings_".time().".xml");
|
||||
|
||||
$fh = fopen($this->data_file, 'w') or die("Error: Can't update the data file");
|
||||
fwrite($fh, $str);
|
||||
fclose($fh);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
$(function(){
|
||||
var offsetX = 20;
|
||||
var offsetY = -300;
|
||||
$('a.hover').hover(function(e){
|
||||
var href = $(this).attr('href');
|
||||
$('<img id="largeImage" src="' + href + '" alt="image" />')
|
||||
.css({'top':e.pageY + offsetY,'left':e.pageX + offsetX})
|
||||
.appendTo('body');
|
||||
}, function(){
|
||||
$('#largeImage').remove();
|
||||
});
|
||||
$('a.hover').mousemove(function(e){
|
||||
$('#largeImage').css({'top':e.pageY + offsetY,'left':e.pageX + offsetX});
|
||||
});
|
||||
$('a.hover').click(function(e){
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
function ValidateSubmit(form)
|
||||
{
|
||||
if(confirm("<?php echo get_lang('sure_to_delete');?>"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<h2><?php echo get_lang('manage_listings');?></h2>
|
||||
|
||||
<div class="news-container">
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="news-row fixed-height">
|
||||
<a href="home.php?m=news&p=admin_news&page=permissions" class="adm_btn perm pull-right">
|
||||
<img src="modules/news/images/permissions.png"> <?php echo get_lang('check_permissions');?>
|
||||
</a>
|
||||
<a href="home.php?m=news&p=admin_news&page=settings" class="adm_btn opt pull-right">
|
||||
<img src="modules/news/images/settings.png"> <?php echo get_lang('config_options');?>
|
||||
</a>
|
||||
<a href="home.php?m=news&p=admin_news&page=add" class="adm_btn add pull-right">
|
||||
<img src="modules/news/images/arrow.png"> <?php echo get_lang('add_new_listing');?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<form class="no-margin" action="home.php?m=news&p=admin_news" method="post" onsubmit="return ValidateSubmit(this)">
|
||||
<input type="hidden" name="proceed_delete" value="1"/>
|
||||
<input type="hidden" name="page" value="home"/>
|
||||
|
||||
<div class="table-responsive table-wrap">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%"><?php echo get_lang('edit');?></th>
|
||||
<th width="10%"><?php echo get_lang('date');?></th>
|
||||
<th width="20%"><?php echo get_lang('images');?></th>
|
||||
<th width="20%"><?php echo get_lang('title');?></th>
|
||||
<th width="40%"><?php echo get_lang('description');?></th>
|
||||
<th width="5%"><?php echo get_lang('delete');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$listings = simplexml_load_file($this->data_file);
|
||||
$i=0;
|
||||
foreach ($listings->listing as $listing)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="home.php?m=news&p=admin_news&page=edit&id=<?php echo $i;?>"><img src="modules/news/images/edit-icon.gif"/></a></td>
|
||||
<td><?php echo date($ini_array["website"]["date_format"],intval($listing->time));?></td>
|
||||
<td>
|
||||
<?php
|
||||
$image_ids = explode(",",$listing->images);
|
||||
$has_image=false;
|
||||
foreach($image_ids as $image_id)
|
||||
{
|
||||
if(file_exists("modules/news/thumbnails/".$image_id.".jpg"))
|
||||
{
|
||||
echo "<a href=\"modules/news/uploaded_images/".$image_id.".jpg\" class=\"hover\"><img src=\"modules/news/thumbnails/".$image_id.".jpg\" class=\"admin-preview-thumbnail no-float\"/></a>";
|
||||
$has_image=true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!$has_image)
|
||||
{
|
||||
?>
|
||||
<img src="modules/news/images/no_pic.gif" width="50" class="admin-preview-thumbnail no-float"/>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo strip_tags(html_entity_decode($listing->title));?></td>
|
||||
<td><?php echo $this->text_words(strip_tags(html_entity_decode($listing->description)),30);?></td>
|
||||
|
||||
<td><input type="checkbox" value="<?php echo $i;?>" name="delete_listings[]"/></td>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="news-row">
|
||||
<button type="submit" class="news-btn news-btn-default pull-right"><?php echo get_lang('delete');?></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="clearfix"></div>
|
||||
<br/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
<?php
|
||||
// News Lister, http://www.netartmedia.net/newslister
|
||||
// A software product of NetArt Media, All Rights Reserved
|
||||
// Find out more about our products and services on:
|
||||
// http://www.netartmedia.net
|
||||
// Released under the MIT license
|
||||
if(!defined('IN_SCRIPT_ADMIN')) {
|
||||
global $db;
|
||||
echo '<h3>'.get_lang('no_access').'</h3>';
|
||||
$abuse_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
$db->logger(get_lang('unauthorized_access').' '.$abuse_link);
|
||||
} else{
|
||||
$id=intval($_REQUEST["id"]);
|
||||
$this->ms_i($id);
|
||||
?>
|
||||
<h2><?php echo get_lang('modify_images');?></h2>
|
||||
<div class="news-row goback"><a href="home.php?m=news&p=admin_news" class="news-btn news-btn-default pull-right"><?php echo get_lang('go_back');?></a></div>
|
||||
|
||||
<div class="news-container" id="main_content">
|
||||
<?php
|
||||
$xml = simplexml_load_file($this->data_file);
|
||||
|
||||
$current_images = trim($xml->listing[$id]->images);
|
||||
|
||||
if(isset($_REQUEST["current"])&&isset($_REQUEST["new"]))
|
||||
{
|
||||
$current=str_replace("img","",$_REQUEST["current"]);
|
||||
$new=str_replace("img","",$_REQUEST["new"]);
|
||||
|
||||
$pos_current=strpos($current_images,$current);
|
||||
$pos_new=strpos($current_images,$new);
|
||||
|
||||
if
|
||||
(
|
||||
$pos_current!==false
|
||||
&&
|
||||
$pos_new!==false
|
||||
)
|
||||
{
|
||||
|
||||
$current_images = str_replace($new,"###",$current_images);
|
||||
$current_images = str_replace($current,$new,$current_images);
|
||||
$current_images = str_replace("###",$current,$current_images);
|
||||
|
||||
$xml->listing[$id]->images=$current_images;
|
||||
$xml->asXML($this->data_file);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
if(isset($_REQUEST["del"]))
|
||||
{
|
||||
$pos=strpos($current_images,$_REQUEST["del"]);
|
||||
|
||||
if($pos!==false)
|
||||
{
|
||||
|
||||
|
||||
$current_images = str_replace($_REQUEST["del"],"",$current_images);
|
||||
$current_images = str_replace(",,",",",$current_images);
|
||||
$current_images = trim($current_images,",");
|
||||
|
||||
$xml->listing[$id]->images=$current_images;
|
||||
$xml->asXML($this->data_file);
|
||||
|
||||
if(file_exists("modules/news/thumbnails/".$_REQUEST["del"].".jpg"))
|
||||
{
|
||||
unlink("modules/news/thumbnails/".$_REQUEST["del"].".jpg");
|
||||
}
|
||||
|
||||
if(file_exists("modules/news/uploaded_images/".$_REQUEST["del"].".jpg"))
|
||||
{
|
||||
unlink("modules/news/uploaded_images/".$_REQUEST["del"].".jpg");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
if(isset($_POST["proceed_save"]))
|
||||
{
|
||||
///images processing
|
||||
$str_images_list = "";
|
||||
$limit_pictures=25;
|
||||
$path="modules/news/";
|
||||
$ini_array = parse_ini_file("modules/news/config.php",true);
|
||||
$image_quality=$ini_array["website"]["image_quality"];
|
||||
$max_image_width=$ini_array["website"]["max_image_width"];
|
||||
|
||||
include("modules/news/include/images_processing.php");
|
||||
///end images processing
|
||||
|
||||
if($current_images != "")
|
||||
{
|
||||
$str_images_list = $current_images.",".$str_images_list;
|
||||
}
|
||||
|
||||
|
||||
$xml->listing[$id]->images=$str_images_list;
|
||||
$xml->asXML($this->data_file);
|
||||
$current_images=$str_images_list;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="news-row">
|
||||
|
||||
<form action="home.php?m=news&p=admin_news" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="page" value="images"/>
|
||||
<input type="hidden" name="proceed_save" value="1"/>
|
||||
<input type="hidden" name="id" value="<?php echo $id;?>"/>
|
||||
|
||||
<script>
|
||||
function Dele(x)
|
||||
{
|
||||
document.location.href="home.php?m=news&p=admin_news&page=images&id=<?php echo $id;?>&del="+x;
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="news-row">
|
||||
<div id="drag_images">
|
||||
<?php
|
||||
$iPicCounter = 0;
|
||||
$image_ids = explode(",",$current_images);
|
||||
|
||||
|
||||
for($i=0;$i<sizeof($image_ids);$i++)
|
||||
{
|
||||
|
||||
if(isset($image_ids[$i]) && $image_ids[$i]!="")
|
||||
{
|
||||
?>
|
||||
|
||||
|
||||
<div ondragstart="javascript:img_drag_start(this)" class="drag_img" id="img<?php echo $image_ids[$i];?>">
|
||||
<a class="pull-right" href="javascript:Dele('<?php echo $image_ids[$i];?>')"><img src="modules/news/images/cancel.gif" alt="<?php echo get_lang('delete');?>" width="21" height="20" border="0"></a>
|
||||
<br>
|
||||
<img src="modules/news/thumbnails/<?php echo $image_ids[$i];?>.jpg" alt="" height="125"/>
|
||||
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span style="display:none">
|
||||
<input type="file" name="userfile<?php echo $i;?>">
|
||||
</span>
|
||||
<?php
|
||||
|
||||
$iPicCounter++;
|
||||
|
||||
}
|
||||
?>
|
||||
</div></div>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="news-row">
|
||||
<br>
|
||||
<?php if (extension_loaded('gd')) { ?>
|
||||
<h3><?php echo get_lang('upload_more_images');?></h3>
|
||||
<br/>
|
||||
<input type="file" class="pull-left" name="images[]" id="images" multiple="multiple"/>
|
||||
|
||||
<button type="submit" class="news-btn news-btn-default pull-left"><?php echo get_lang('submit');?></button>
|
||||
<?php
|
||||
}else{
|
||||
echo "<h3><span class='failure'>".get_lang('gd_fail')."</span></h3>";
|
||||
}
|
||||
?></div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
|
||||
function init_drag()
|
||||
{
|
||||
|
||||
$('.drag_img').draggable( {
|
||||
containment: '#main_content',
|
||||
revert: true
|
||||
} );
|
||||
|
||||
$('.drag_img').droppable( {
|
||||
drop: handle_drop
|
||||
} );
|
||||
|
||||
|
||||
}
|
||||
|
||||
function handle_drop( event, ui )
|
||||
{
|
||||
var id = $(this).attr('id');
|
||||
var draggable = ui.draggable;
|
||||
|
||||
document.location.href="home.php?m=news&p=admin_news&page=images&id=<?php echo $id;?>¤t="+id+"&new="+draggable.attr('id');
|
||||
|
||||
}
|
||||
var x_index=100;
|
||||
function img_drag_start(x)
|
||||
{
|
||||
x_index=x_index+100;
|
||||
x.style.zIndex=x_index;
|
||||
}
|
||||
|
||||
$(init_drag);
|
||||
</script>
|
||||
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br/><br/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<?php
|
||||
// News Lister
|
||||
?>
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
<?php
|
||||
if(!defined('IN_SCRIPT_ADMIN')) {
|
||||
global $db;
|
||||
echo '<h3>'.get_lang('no_access').'</h3>';
|
||||
$abuse_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
$db->logger(get_lang('unauthorized_access').' '.$abuse_link);
|
||||
}
|
||||
else{ ?>
|
||||
<h2><?php echo get_lang('check_permissions');?></h2>
|
||||
<div class="news-row goback"><a href="home.php?m=news&p=admin_news" class="news-btn news-btn-default pull-right"><?php echo get_lang('go_back');?></a></div>
|
||||
|
||||
<?php
|
||||
// Permissions check
|
||||
// Check if the file "modules/news/config.php" is writable
|
||||
$value = 'modules/news/config.php';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span></h3>";
|
||||
$failed = true;
|
||||
}
|
||||
else {
|
||||
echo "<h3>".$value." : <span class='success'>".get_lang('OK')."</span></h3>";
|
||||
}
|
||||
// Check if the folder "modules/news/data/" is writable
|
||||
$value = 'modules/news/data/';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span></h3>";
|
||||
$failed = true;
|
||||
}
|
||||
else {
|
||||
echo "<h3>".$value." : <span class='success'>".get_lang('OK')."</span></h3>";
|
||||
}
|
||||
// Check if the file "modules/news/data/listings.xml" is writable
|
||||
$value = 'modules/news/data/listings.xml';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span></h3>";
|
||||
$failed = true;
|
||||
}
|
||||
else {
|
||||
echo "<h3>".$value." : <span class='success'>".get_lang('OK')."</span></h3>";
|
||||
}
|
||||
// Check if the folder "modules/news/uploads" is writable
|
||||
$value = 'modules/news/uploads';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span></h3>";
|
||||
$failed = true;
|
||||
}
|
||||
else {
|
||||
echo "<h3>".$value." : <span class='success'>".get_lang('OK')."</span></h3>";
|
||||
}
|
||||
// Check if the folder "modules/news/uploaded_images" is writable
|
||||
$value = 'modules/news/uploaded_images';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span></h3>";
|
||||
$failed = true;
|
||||
}
|
||||
else {
|
||||
echo "<h3>".$value." : <span class='success'>".get_lang('OK')."</span></h3>";
|
||||
}
|
||||
// Check if the folder "modules/news/thumbnails" is writable
|
||||
$value = 'modules/news/thumbnails';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span></h3>";
|
||||
$failed = true;
|
||||
}
|
||||
else {
|
||||
echo "<h3>".$value." : <span class='success'>".get_lang('OK')."</span></h3>";
|
||||
}
|
||||
|
||||
if ( $failed ) {
|
||||
echo "<br /><br /><h3>".get_lang('fix_permission')."</h3><p><a href='?m=news&p=admin_news&page=permissions'>".get_lang('refresh')."</a></p>";
|
||||
} else {
|
||||
echo "<br /><br /><h3>".get_lang('permission_ok')."</h3>";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
<?php
|
||||
// News Lister
|
||||
// http://www.netartmedia.net/newslister
|
||||
// Copyright (c) All Rights Reserved NetArt Media
|
||||
// Find out more about our products and services on:
|
||||
// http://www.netartmedia.net
|
||||
// Released under the MIT license
|
||||
|
||||
if(!defined('IN_SCRIPT')) die("");
|
||||
if (!empty($_SESSION['user_id'])) {$homex="home";} else {$homex="index";}?>
|
||||
|
||||
<h2>
|
||||
<?php
|
||||
if(isset($_REQUEST["keyword_search"])) {
|
||||
echo get_lang('search_results');
|
||||
} else {
|
||||
echo get_lang('latest_news');
|
||||
}
|
||||
?></h2>
|
||||
|
||||
<?php if($this->settings["website"]["enable_search"]==1) { ?>
|
||||
<div class="news-row"><form action="<?php echo $homex;?>.php?m=news&p=news" method="post">
|
||||
<input type="hidden" name="page" value="results"/>
|
||||
<input type="hidden" name="proceed_search" value="1"/>
|
||||
<input id="search" required name="keyword_search" placeholder="<?php if(isset($_REQUEST["keyword_search"])) { echo stripslashes($_REQUEST["keyword_search"]);} else { echo get_lang('search_news');}?>" type="text" class="searchmod pull-right"/>
|
||||
</form></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<br/>
|
||||
<div class="clearfix"></div>
|
||||
<div class="news-container">
|
||||
|
||||
<?php
|
||||
$PageSize = intval($this->settings["website"]["results_per_page"]);
|
||||
|
||||
if(!isset($_REQUEST["num"]))
|
||||
{
|
||||
$num=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$num=$_REQUEST["num"];
|
||||
$this->ms_i($num);
|
||||
}
|
||||
|
||||
$listings = simplexml_load_file($this->data_file);
|
||||
|
||||
//reversing the array with the news to show the latest first
|
||||
$xml_results = array();
|
||||
foreach ($listings->listing as $xml_element) $xml_results[] = $xml_element;
|
||||
$xml_results = array_reverse($xml_results);
|
||||
//end reversing the order of the array
|
||||
|
||||
$iTotResults = 0;
|
||||
$listing_counter=sizeof($xml_results);
|
||||
|
||||
foreach ($xml_results as $listing)
|
||||
{
|
||||
$listing_counter--;
|
||||
|
||||
//refine search
|
||||
if(isset($_REQUEST["keyword_search"])&&trim($_REQUEST["keyword_search"])!="")
|
||||
{
|
||||
if
|
||||
(
|
||||
stripos($listing->title, $_REQUEST["keyword_search"])===false
|
||||
&&
|
||||
stripos($listing->description, $_REQUEST["keyword_search"])===false
|
||||
)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//end refine search
|
||||
|
||||
|
||||
if($iTotResults>=($num-1)*$PageSize&&$iTotResults<$num*$PageSize)
|
||||
{
|
||||
|
||||
$images=explode(",",$listing->images);
|
||||
|
||||
$strLink = $homex.".php?m=news&p=news&page=details&id=".$listing_counter;
|
||||
|
||||
?>
|
||||
|
||||
<div class="panel panel-default search-result">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
|
||||
<a href="<?php echo $strLink;?>" class="search-result-title"><?php echo strip_tags(html_entity_decode($listing->title));?></a>
|
||||
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="news-row">
|
||||
<?php if($images[0]!=""||file_exists("modules/news/thumbnails/".$images[0].".jpg")) { ?>
|
||||
<div class="news-img pull-left">
|
||||
<a href="<?php echo $strLink;?>" class="news-btn-block"><img alt="<?php echo strip_tags(html_entity_decode($listing->title));?>" class="img-responsive" src="<?php echo "modules/news/thumbnails/".$images[0].".jpg";?>"/></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="news-auto">
|
||||
<?php
|
||||
require_once('modules/news/include/library/HTMLPurifier.auto.php');
|
||||
$purificateur = new HTMLPurifier();
|
||||
echo $purificateur->purify($this->text_words($listing->description,80));?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="news-row">
|
||||
<div class="news-half pull-left">
|
||||
|
||||
</div>
|
||||
<div class="news-half pull-right">
|
||||
<a href="<?php echo $strLink;?>" class="news-btn news-btn-default pull-right"><?php echo get_lang('details');?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
}
|
||||
|
||||
$iTotResults++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<?php
|
||||
$strSearchString = "";
|
||||
|
||||
foreach ($_POST as $key=>$value)
|
||||
{
|
||||
if($key != "num"&&$value!="")
|
||||
{
|
||||
$strSearchString .= $key."=".$value."&";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_GET as $key=>$value)
|
||||
{
|
||||
if($key != "num"&&$value!="")
|
||||
{
|
||||
$strSearchString .= $key."=".$value."&";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(ceil($iTotResults/$PageSize) > 1)
|
||||
{
|
||||
echo '<ul class="pagination">';
|
||||
|
||||
|
||||
|
||||
$inCounter = 0;
|
||||
|
||||
if($num > 2)
|
||||
{
|
||||
echo "<li><a class=\"pagination-link\" href=\"".$homex.".php?".$strSearchString."num=1\"> << </a></li>";
|
||||
|
||||
echo "<li><a class=\"pagination-link\" href=\"".$homex.".php?".$strSearchString."num=".($num-1)."\"> < </a></li>";
|
||||
}
|
||||
|
||||
$iStartNumber = $num-2;
|
||||
|
||||
|
||||
if($iStartNumber < 1)
|
||||
{
|
||||
$iStartNumber = 1;
|
||||
}
|
||||
|
||||
for($i= $iStartNumber ;$i<=ceil($iTotResults/$PageSize);$i++)
|
||||
{
|
||||
if($inCounter>=5)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if($i == $num)
|
||||
{
|
||||
echo "<li><a><b>".$i."</b></a></li>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<li><a class=\"pagination-link\" href=\"".$homex.".php?".$strSearchString."num=".$i."\">".$i."</a></li>";
|
||||
}
|
||||
|
||||
|
||||
$inCounter++;
|
||||
}
|
||||
|
||||
if(($num+1)<ceil($iTotResults/$PageSize))
|
||||
{
|
||||
echo "<li><a href=\"".$homex.".php?".$strSearchString."num=".($num+1)."\"> ></b></a></li>";
|
||||
|
||||
echo "<li><a href=\"".$homex.".php?".$strSearchString."num=".(ceil($iTotResults/$PageSize))."\"> >> </a></li>";
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($iTotResults==0)
|
||||
{
|
||||
?>
|
||||
<h3><span class='failure'><?php echo get_lang('no_results');?></span></h3>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
<?php
|
||||
// News Lister
|
||||
// Copyright (c) All Rights Reserved, NetArt Media 2003-2016
|
||||
// Check http://www.netartmedia.net/newslister for demos and information
|
||||
// Released under the MIT license
|
||||
if(!defined('IN_SCRIPT_ADMIN')) {
|
||||
global $db;
|
||||
echo '<h3>'.get_lang('no_access').'</h3>';
|
||||
$abuse_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||
$db->logger(get_lang('unauthorized_access').' '.$abuse_link);
|
||||
}
|
||||
else {
|
||||
?>
|
||||
|
||||
<h2><?php echo get_lang('config_options');?></h2>
|
||||
<div class="news-row goback"><a href="home.php?m=news&p=admin_news" class="news-btn news-btn-default pull-right"><?php echo get_lang('go_back');?></a></div>
|
||||
|
||||
<div class="news-container">
|
||||
<?php
|
||||
// Check if the file "modules/news/config.php" is writable
|
||||
$value = 'modules/news/config.php';
|
||||
if ( !is_writable($value) ) {
|
||||
echo "<h3>".$value." : <span class='failure'>".get_lang('write_permission_required')."</span> <a href=\"home.php?m=news&p=admin_news&page=permissions\">".get_lang('check_permissions')."</a></h3><br/><br/>";
|
||||
}
|
||||
|
||||
$ini_array = parse_ini_file("modules/news/config.php",true);
|
||||
|
||||
if(isset($_POST["proceed_save"]))
|
||||
{
|
||||
$ini_array["website"]["date_format"]=stripslashes($_POST["date_format"]);
|
||||
$ini_array["website"]["results_per_page"]=stripslashes($_POST["results_per_page"]);
|
||||
$ini_array["website"]["enable_search"]=stripslashes($_POST["enable_search"]);
|
||||
$ini_array["website"]["image_quality"]=stripslashes($_POST["image_quality"]);
|
||||
$ini_array["website"]["max_image_width"]=stripslashes($_POST["max_image_width"]);
|
||||
$ini_array["website"]["images_bottom"]=stripslashes($_POST["images_bottom"]);
|
||||
$ini_array["website"]["gallery_theme"]=stripslashes($_POST["gallery_theme"]);
|
||||
$ini_array["website"]["WYSIWYG"]=stripslashes($_POST["WYSIWYG"]);
|
||||
$ini_array["website"]["tinymce_lang"]=stripslashes($_POST["tinymce_lang"]);
|
||||
$ini_array["website"]["tinymce_skin"]=stripslashes($_POST["tinymce_skin"]);
|
||||
|
||||
$this->write_ini_file("modules/news/config.php", $ini_array);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="news-row">
|
||||
<div class="news-row">
|
||||
<br/>
|
||||
<form id="main" action="home.php?m=news&p=admin_news" method="post">
|
||||
<input type="hidden" name="page" value="settings"/>
|
||||
<input type="hidden" name="proceed_save" value="1"/>
|
||||
|
||||
<fieldset>
|
||||
<ol>
|
||||
|
||||
<script>
|
||||
function handleChange(input) {
|
||||
if (input.value < 1) input.value = 1;
|
||||
if (input.value > 100) input.value = 100;
|
||||
}
|
||||
</script>
|
||||
|
||||
<li>
|
||||
<label><?php echo get_lang('date_format');?> (<a href="http://php.net/manual/function.date.php" title="<?php echo get_lang('help_date');?>" target="_blank"><?php echo get_lang('help');?></a>):</label>
|
||||
|
||||
<input type="text" name="date_format" value="<?php echo $ini_array["website"]["date_format"];?>"/>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('results_per_page');?>:</label>
|
||||
|
||||
<input type="number" name="results_per_page" value="<?php echo $ini_array["website"]["results_per_page"];?>" onchange="handleChange(this);"/>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('image_quality');?>:</label>
|
||||
|
||||
<input type="number" name="image_quality" value="<?php echo $ini_array["website"]["image_quality"];?>" onchange="handleChange(this);"/>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('max_image_width');?>:</label>
|
||||
|
||||
<input type="number" name="max_image_width" value="<?php echo $ini_array["website"]["max_image_width"];?>"/>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('enable_search');?>:</label>
|
||||
|
||||
<select name="enable_search">
|
||||
<option value="0" <?php if($ini_array["website"]["enable_search"]=="0") echo "selected";?>><?php echo get_lang('no_word');?></option>
|
||||
<option value="1" <?php if($ini_array["website"]["enable_search"]=="1") echo "selected";?>><?php echo get_lang('yes_word');?></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('wysiwyg');?>:</label>
|
||||
|
||||
<select name="WYSIWYG">
|
||||
<option value="TinyMCE" <?php if($ini_array["website"]["WYSIWYG"]=="TinyMCE") echo "selected";?>>Tiny MCE</option>
|
||||
<option value="NicEdit" <?php if($ini_array["website"]["WYSIWYG"]=="NicEdit") echo "selected";?>>Nic Edit</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('tinymce_lang');?>:</label>
|
||||
|
||||
<select name="tinymce_lang">
|
||||
<option value="da" <?php if($ini_array["website"]["tinymce_lang"]=="da") echo "selected";?>><?php echo get_lang('da');?></option>
|
||||
<option value="de" <?php if($ini_array["website"]["tinymce_lang"]=="de") echo "selected";?>><?php echo get_lang('de');?></option>
|
||||
<option value="en_GB" <?php if($ini_array["website"]["tinymce_lang"]=="en_GB") echo "selected";?>><?php echo get_lang('en_GB');?></option>
|
||||
<option value="es" <?php if($ini_array["website"]["tinymce_lang"]=="es") echo "selected";?>><?php echo get_lang('es');?></option>
|
||||
<option value="fi" <?php if($ini_array["website"]["tinymce_lang"]=="fi") echo "selected";?>><?php echo get_lang('fi');?></option>
|
||||
<option value="fr_FR" <?php if($ini_array["website"]["tinymce_lang"]=="fr_FR") echo "selected";?>><?php echo get_lang('fr_FR');?></option>
|
||||
<option value="it" <?php if($ini_array["website"]["tinymce_lang"]=="it") echo "selected";?>><?php echo get_lang('it');?></option>
|
||||
<option value="pl" <?php if($ini_array["website"]["tinymce_lang"]=="pl") echo "selected";?>><?php echo get_lang('pl');?></option>
|
||||
<option value="pt_PT" <?php if($ini_array["website"]["tinymce_lang"]=="pt_PT") echo "selected";?>><?php echo get_lang('pt_PT');?></option>
|
||||
<option value="ru" <?php if($ini_array["website"]["tinymce_lang"]=="ru") echo "selected";?>><?php echo get_lang('ru');?></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('tinymce_skin');?>:</label>
|
||||
|
||||
<select name="tinymce_skin">
|
||||
<option value="lightgray" <?php if($ini_array["website"]["tinymce_skin"]=="lightgray") echo "selected";?>>lightgray</option>
|
||||
<option value="lightgray-gradient" <?php if($ini_array["website"]["tinymce_skin"]=="lightgray-gradient") echo "selected";?>>lightgray-gradient</option>
|
||||
<option value="charcoal" <?php if($ini_array["website"]["tinymce_skin"]=="charcoal") echo "selected";?>>charcoal</option>
|
||||
<option value="tundora" <?php if($ini_array["website"]["tinymce_skin"]=="tundora") echo "selected";?>>tundora</option>
|
||||
<option value="custom" <?php if($ini_array["website"]["tinymce_skin"]=="custom") echo "selected";?>>custom</option>
|
||||
</select>
|
||||
<?php if($ini_array["website"]["tinymce_skin"]=="custom") { ?><br><p><img src="modules/news/images/warning.png"> <?php echo get_lang('tinymce_skin_custom'); ?></p> <?php } ?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('gallery_theme');?>:</label>
|
||||
|
||||
<select name="gallery_theme">
|
||||
<option value="default" <?php if($ini_array["website"]["gallery_theme"]=="default") echo "selected";?>>Default</option>
|
||||
<option value="light_rounded" <?php if($ini_array["website"]["gallery_theme"]=="light_rounded") echo "selected";?>>Light Rounded</option>
|
||||
<option value="light_square" <?php if($ini_array["website"]["gallery_theme"]=="light_square") echo "selected";?>>Light Square</option>
|
||||
<option value="dark_rounded" <?php if($ini_array["website"]["gallery_theme"]=="dark_rounded") echo "selected";?>>Dark Rounded</option>
|
||||
<option value="dark_square" <?php if($ini_array["website"]["gallery_theme"]=="dark_square") echo "selected";?>>Dark Square</option>
|
||||
<option value="facebook" <?php if($ini_array["website"]["gallery_theme"]=="facebook") echo "selected";?>>Facebook</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('images_bottom');?>:</label>
|
||||
|
||||
<select name="images_bottom">
|
||||
<option value="0" <?php if($ini_array["website"]["images_bottom"]=="0") echo "selected";?>><?php echo get_lang('img_right');?></option>
|
||||
<option value="1" <?php if($ini_array["website"]["images_bottom"]=="1") echo "selected";?>><?php echo get_lang('img_bottom');?></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php echo get_lang('safe_HTML');?>:</label>
|
||||
<select name="enable_safe_HTML" disabled>
|
||||
<option value="0" <?php if($ini_array["website"]["safe_HTML"]=="0") echo "selected";?>><?php echo get_lang('safe_HTML_dis');?></option>
|
||||
<option value="1" <?php if($ini_array["website"]["safe_HTML"]=="1") echo "selected";?>><?php echo get_lang('safe_HTML_en');?></option>
|
||||
</select>
|
||||
<br><p><?php if($ini_array["website"]["safe_HTML"]=="1") { echo get_lang('safe_HTML_en_info');} else { echo get_lang('safe_HTML_dis_info');} ?></p>
|
||||
</li>
|
||||
|
||||
<ol>
|
||||
</fieldset>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<br/>
|
||||
<button type="submit" class="news-btn news-btn-default pull-right"><?php echo get_lang('save');?></button>
|
||||
<br/>
|
||||
<div class="clearfix"></div>
|
||||
<br/>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
<site content/>
|
||||
Loading…
Add table
Add a link
Reference in a new issue