Skip to content

Commit

Permalink
Updates RSS module
Browse files Browse the repository at this point in the history
  • Loading branch information
GodMod committed Dec 28, 2018
1 parent 7eab945 commit e6ff532
Show file tree
Hide file tree
Showing 5 changed files with 449 additions and 86 deletions.
24 changes: 12 additions & 12 deletions language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


if (!defined('EQDKP_INC')) {
die('You cannot access this file directly.');
}

//Language: English
//Language: English
//Created by EQdkp Plus Translation Tool on 2014-12-17 23:17
//File: portal/rssfeed/language/english.php
//Source-Language: german

$lang = array(
"rssfeed" => 'RSS Feeds',
"rssfeed_name" => 'RSS Feed Module',
"rssfeed_desc" => 'Shows an RSS Feed in portal',
"rssfeed_f_limit" => 'Amount of feed items to show',
"rssfeed_f_url" => 'URL of the RSS Feed',
"pk_rssfeed_nourl" => 'Please setup a Feed first',
"rssfeed_f_length" => 'Number of chars that should be displayed from the text',
"rssfeed_f_help_length" => 'If the feed-module becomes extreme wide, the problem may be a destroyed HTML-Tag, because of the limited characters. If there are many characters without a white-space in that tag, there will be no new line and so the whole left-column becomes very wide.',

$lang = array(
"rssfeed" => 'RSS Feeds',
"rssfeed_name" => 'RSS Feed Module',
"rssfeed_desc" => 'Shows an RSS Feed in portal',
"rssfeed_f_limit" => 'Amount of feed items to show',
"rssfeed_f_url" => 'URL of the RSS Feed',
"pk_rssfeed_nourl" => 'Please setup a Feed first',
"rssfeed_f_length" => 'Number of chars that should be displayed from the text',
"rssfeed_f_help_length" => 'If the feed-module becomes extreme wide, the problem may be a destroyed HTML-Tag, because of the limited characters. If there are many characters without a white-space in that tag, there will be no new line and so the whole left-column becomes very wide.',
'rssfeed_f_layout' => 'Layout',
);

?>
16 changes: 8 additions & 8 deletions language/german.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
}

$lang = array(
'rssfeed' => 'RSS Feeds',
'rssfeed_name' => 'RSS Feed Module',
'rssfeed_desc' => 'Zeigt einen RSS Feed im Portal an',
'rssfeed_f_limit' => 'Anzahl der Feedeinträge zur Anzeige',
'rssfeed_f_url' => 'URL des RSS Feeds',
'pk_rssfeed_nourl' => 'Es wurde kein Feed angegeben',
'rssfeed_f_length' => 'Anzahl Zeichen vom Feed zur Anzeige',
'rssfeed_f_help_length' => 'Wenn das Feed-Modul extrem breit wird, liegt es unter Umständen daran, dass durch die Anzahl Zeichen ein HTML-Tag zerstört wird. Wenn in dem Tag sehr viele Zeichen stehen, kann kein Zeilenumbruch erfolgen und die linke Spalte wird sehr breit.',
'rssfeed' => 'RSS Feeds',
'rssfeed_name' => 'RSS Feed Module',
'rssfeed_desc' => 'Zeigt einen RSS Feed im Portal an',
'rssfeed_f_limit' => 'Anzahl der Feedeinträge zur Anzeige',
'rssfeed_f_url' => 'URL des RSS Feeds',
'pk_rssfeed_nourl' => 'Es wurde kein Feed angegeben',
'rssfeed_f_length' => 'Anzahl Zeichen vom Feed zur Anzeige',
'rssfeed_f_layout' => 'Darstellung',
);
?>
130 changes: 64 additions & 66 deletions rssfeed_portal.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/* Project: EQdkp-Plus
* Package: RSS Feed Portal Module
* Package: RSS Portal Module
* Link: http://eqdkp-plus.eu
*
* Copyright (C) 2006-2015 EQdkp-Plus Developer Team
* Copyright (C) 2006-2018 EQdkp-Plus Developer Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -27,81 +27,79 @@ class rssfeed_portal extends portal_generic {

protected static $path = 'rssfeed';
protected static $data = array(
'name' => 'RSS Feed',
'version' => '3.0.0',
'author' => 'WalleniuM',
'icon' => 'fa-rss-square',
'contact' => EQDKP_PROJECT_URL,
'description' => 'Shows an RSS Feed in portal',
'lang_prefix' => 'rssfeed_'
'name' => 'RSS Feed',
'version' => '4.0.0',
'author' => 'GodMod',
'icon' => 'fa-rss-square',
'contact' => EQDKP_PROJECT_URL,
'description' => 'Shows an RSS Feed in portal',
'lang_prefix' => 'rssfeed_',
'multiple' => true,
);
protected static $positions = array('left1', 'left2', 'right');
protected $settings = array(
'url' => array(
'type' => 'text',
'size' => '40',
),
'limit' => array(
'type' => 'text',
'size' => '5',
),
'length' => array(
'type' => 'text',
'size' => '3',
)
'url' => array(
'type' => 'text',
'size' => '40',
),
'limit' => array(
'type' => 'text',
'size' => '5',
),
'length' => array(
'type' => 'text',
'size' => '3',
),
'layout' => array(
'type' => 'dropdown',
'options' => array('direct' => 'Direct', 'accordion' => 'Accordion'),
)
);
protected static $install = array(
'autoenable' => '1',
'defaultposition' => 'left2',
'defaultnumber' => '9',
'autoenable' => '1',
'defaultposition' => 'left2',
'defaultnumber' => '9',
);

protected static $apiLevel = 20;

public function output() {
if($this->config('url')){
$pk_rssfeed_limit = ($this->config('limit')) ? $this->config('limit') : 5;
$pk_rssfeed_length = ($this->config('length')) ? $this->config('length') : 80;
$this->tpl->add_css("
#rssfeed_module{
margin:0;
padding:5px;
height:200px;
overflow: auto;
}
#rssfeed_module a {
color:#FF9900;
margin-bottom: 3px;
}
#rssfeed_module .rss_readmore{
font-size:10px;
margin-bottom: 5px;
}
#rssfeed_module .date{
color:#999999;
font-size:9px;
margin: 3px 0 3px 0;
}
#rssfeed_module .description{
margin:0;
padding:0;
}
#rssfeed_module .description p {
font-size:10px;
}
.mf-viral {display:none;}
.loading{
margin:25% 0% 0% 25%;
float:left;
}");
$output = '<div id="rssfeed_module"></div>';

// JS Part
$this->jquery->rssFeeder('rssfeed_module', $this->server_path."portal/rssfeed/load.php".$this->SID."&loadrss=true&moduleid=".$this->id, $pk_rssfeed_limit, $pk_rssfeed_length);
}else{
$output = $this->user->lang('pk_rssfeed_nourl');
//Calculate Max Width
if($this->user->style['column_left_width'] != ""){
if(strpos($this->user->style['column_left_width'], 'px') !== false){
$max_width = (intval($this->user->style['column_left_width']) - 30).'px';
} else {
$max_width = '97%';
}

} else {
$max_width = "180px";
}

$this->tpl->add_css(
'.rssfeed_portal .ui-accordion .ui-accordion-content {
padding: 4px;
}
.rssfeed-wrapper {
height:250px;
overflow: auto;
}
.rssfeed-content {
max-width: '.$max_width.';
word-wrap:break-word;
padding-top: 5px;
}
'
);

include_once($this->root_path .'portal/rssfeed/rssfeed_rss.class.php');
$class = registry::register('rssfeed_rss', array($this->id));
$output = $class->output;

return $output;
}
}
?>
?>
Loading

0 comments on commit e6ff532

Please sign in to comment.