Re: Classifieds Mod für Portal
Verfasst: 06.08.2011 19:14
-vorheriger Post aktualisiert-
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Ja, hätt ich gern. Mein Style ist der original Prosilver.Insofern du eine spezielle Position haben möchtest, schreib bitte mit Angabe deines Templates (prosilver-basiert) auf, wo du diesen genau platziert haben möchtest.
Code: Alles auswählen
<!-- IF S_CENTER_COLUMN -->
<td valign="top">
Code: Alles auswählen
<!-- INCLUDE portal/modules/classifieds.html -->
Code: Alles auswählen
'CL_PHONE' => 'Telefonnummer',
Code: Alles auswählen
'CL_PRICE' => 'Preis',
'CL_BY' => 'von',
Code: Alles auswählen
<?php
/**
*
* @package - Board3portal v2 Classifieds Mod Modul
* @copyright (c) Board3 Group ( www.board3.de )
* @copyright (c) 2011 Kirk http://www.quad-atv-freunde-wunsiedel.de/
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* @package Board online Date
*/
class portal_classifieds_mod_module
{
/**
* Allowed columns: Just sum up your options (Exp: left + right = 10)
* top 1
* left 2
* center 4
* right 8
* bottom 16
*/
public $columns = 21;
/**
* Default modulename
*/
public $name = 'PORTAL_CLASSIFIEDS_MOD';
/**
* Default module-image:
* file must be in "{T_THEME_PATH}/images/portal/"
*/
public $image_src = '';
/**
* module-language file
* file must be in "language/{$user->lang}/mods/portal/"
*/
public $language = 'portal_classifieds_mod_module';
/**
* custom acp template
* file must be in "adm/style/portal/"
*/
public $custom_acp_tpl = '';
/**
* hide module name in ACP configuration page
*/
public $hide_name = false;
public function get_template_center($module_id)
{
global $config, $template, $user, $phpEx, $phpbb_root_path, $auth;
// MOD :: CLASSIFIEDS MOD -- START
if (isset($config['enable_classifieds']))
{
if($config['enable_classifieds'] && $auth->acl_get('u_view_classifieds') && ( ($config['display_ads_on_index'] && $config['ad_num_display_on_index'] !='0') || ($config['display_rand_ads_on_index'] && $config['rand_ad_num_display_on_index'] !='0') ) )
{
include($phpbb_root_path . CL_DIRECTORY . '/includes/functions_buysell.' . $phpEx);
$user->setup('mods/classified');
if ($config['display_ads_on_index'])
{
display_recent_ads($config['ad_num_display_on_index']);
$template->assign_vars(array(
'S_DISPLAY_ADS_ON_INDEX' => true,
'S_RECENT_ADS_TOP' => ($config['recent_ads_place']) ? true : false,
));
}
if ($config['display_rand_ads_on_index'] )
{
display_random_ads($config['rand_ad_num_display_on_index']);
$template->assign_vars(array(
'S_DISPLAY_RAND_ADS_ON_INDEX' => true,
'S_RAND_ADS_TOP' => ($config['rand_ads_place']) ? true : false,
));
}
}
}
// MOD :: CLASSIFIEDS MOD -- END
return 'portal_classifieds_mod_center.html';
}
public function get_template_acp($module_id)
{
return array(
'title' => 'PORTAL_CLASSIFIEDS_MOD',
'vars' => array(),
);
}
/**
* API functions
*/
public function install($module_id)
{
return true;
}
public function uninstall($module_id)
{
return true;
}
}
Code: Alles auswählen
<?php
/**
*
* @package - Board3portal v2 Classifieds Mod Modul
* @copyright (c) Board3 Group ( www.board3.de )
* @copyright (c) 2011 Kirk http://www.quad-atv-freunde-wunsiedel.de/
* @version 1.1.0
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
'PORTAL_CLASSIFIEDS_MOD' => 'Kleinanzeigen',
));
?>
Code: Alles auswählen
{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
<ul class="topiclist bg1">
<!-- BEGIN rand_ad -->
<li><dl>
<dd style="border-left:0px">
<li class="row bg2 classifieds_block" <p style="margin: 5px 5px 5px 5px;"><!-- IF rand_ad.S_LAST_ROW and rand_ad.S_ROW_COUNT is even -->style="width:100%;"<!-- ENDIF -->
<dl>
<dd>
<div class="cl_thumb">
<!-- IF rand_ad.THUMB -->
<img src="{rand_ad.THUMB}" alt="{rand_ad.TITLE}" />
<!-- ELSE -->
<img src="{T_THEME_PATH}/images/noimage.gif" alt="{rand_ad.TITLE}" />
<!-- ENDIF -->
</div>
<div class="cl_desc">
<a href="{rand_ad.AD_LINK}"><b>{rand_ad.AD_TITLE}</b></a><br />
{L_IN} <b>{rand_ad.CATEGORY}</b><br />
<b>{L_CL_PRICE}</b>: {rand_ad.AD_PRICE} <i>{L_CL_BY}</i> {rand_ad.AD_POSTER}
</div>
</dd>
</dl>
</p> </li>
</dd>
</dl></li>
<!-- END rand_ad -->
</ul>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}