Новости Joomla

Вышли релизы Joomla 6.1 и Joomla 5.4.5: новые возможности и стабильность

Релиз Joomla 6.1.0

Проект Joomla! объявил о доступности Joomla 6.1 [Nyota] — новой минорной версии шестой серии, а также о выпуске релиза исправлений ошибок Joomla 5.4.5. Релиз 6.1 приносит ряд долгожданных функций, повышающих удобство управления контентом и защиту от спама.

👩‍💻 Компонент "CS Афиши" для Joomla.

👩‍💻 Компонент "CS Афиши" для Joomla.

Расширение "CS Афиши" позволяет выводить список мероприятий, фильтровать их по датам, поиск по заголовкам и описанию.

В состав пакета расширений входят:
- Компонент "CS Афиши"
- Модуль "Календарь событий"
- Модуль "Предстоящие события"
- Библиотека "ImgResize"

Расширение "CS Афиши" позволяет выводить список мероприятий, фильтровать их по датам, поиск по заголовкам и описанию.

Модуль "Календарь событий" отображает предстоящие и прошедшие мероприятие на календаре, с отображением мероприятий на конкретную дату во всплывающем окне.

Модуль "Предстоящие события" показывает список предстоящий событий по порядку их наступления.

P.S. Расширение платное, но плата символическая, чисто для отработки приема платежей. Ключи без ограничения по времени, купившие сейчас - смогут обновляться без ограничений.

Разработчик - участник нашего сообщества Дмитрий Денисов (@codersite).

Страница расширения
Демо

0 Пользователей и 1 Гость просматривают эту тему.
  • 3 Ответов
  • 2862 Просмотров
*

Сergei

  • Захожу иногда
  • 189
  • 0 / 0
Всех с Наступающим Новым Годом!
Вопрос, как сделать в плагине списание баллов после клика по определенной ссылке, т.е. кликнув по ссылке, появляется сообщение, что
"Списано столько-то поинтов" или "У Вас не достаточно баллов для данной функции".
В каком именно файле и где нужно будет вставить код или одним только кодом не обойтись, и придеться дописывать сам код плагина/модуля?

Имеется ввиду API:

Код: php
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
if ( file_exists($api_AUP))
{
    require_once ($api_AUP);
    AlphaUserPointsHelper::newpoints( 'function_name' );
}
« Последнее редактирование: 27.12.2012, 13:16:20 от Сergei »
*

migus

  • Moderator
  • 992
  • 144 / 0
  • OPEN THE BOX
Вы дали слишком мало информации. В каком плагине? Где расположена ссылка и т.п. Опишите вашу задачу подробнее, чего хотите реализовать?
"The Lord Of A SandBox"
*

Сergei

  • Захожу иногда
  • 189
  • 0 / 0
Плагин Profile Designer http://www.joomplace.com/jomsocial_plugins/profile-designer.html
Клик по ссылке "Change background" должен вызывать сообщение о снятии баллов или предупреждение о нехватке баллов.

файл profdesigner.php

Код: php
defined('_JEXEC') or die('Restricted access');

require_once( JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php');

if (!class_exists('plgCommunityProfdesigner')) {
class plgCommunityProfdesigner extends CApplications {
var $_ajax = false;

    function plgCommunityProfdesigner(&$subject, $config) {
parent::__construct($subject, $config);
JPlugin::loadLanguage('plg_profdesigner', JPATH_ADMINISTRATOR);
JHTML::_('behavior.mootools');
    }

function onSystemStart() {
// are we uploading an image?
if (JRequest::getBool('brkupload')) {
$this->_upload();
}

// add assets
if ( JRequest::getCmd('view') == 'profile' && !JRequest::getCmd('task') && (JFactory::getUser()->id == JRequest::getInt('userid') || !JRequest::getInt('userid')) ) {
if( $this->params->get('show_in_menu') ) {
CFactory::getToolbar()->addItem('PROFILE', 'BACKGROUND_EDIT', JText::_('Change background'), 'Profdesigner.cAppsBackground(\''.JString::str_ireplace("'", "\\'", JText::_('Change background')).'\');', '', true);
CFactory::getToolbar()->addItem('PROFILE', 'COLOR_EDIT', JText::_('Change font color'), 'Profdesigner.cAppsBackground2(\''.JString::str_ireplace("'", "\\'", JText::_('Change font color')).'\');', '', true);
}

JFactory::getDocument()->addScript(JUri::base(). 'plugins/community/profdesigner/script.js?v3');
}

if (JRequest::getCmd('view') == 'profile' && !JRequest::getCmd('task')) {
$data = $this->_getData();
if (isset($data['color'])) {
// color
$css = (strlen($data['color']))? '#'.$data['color'].' ' : '';
// attachment
$css .= $data['attach'].' ';
// images
switch($data['type']) {
case 'upload':
$cuser =& CFactory::getActiveProfile();
$css .= 'url("'.substr(JURI::base(), 0, -1).$this->params->get('upload_path').'/'.$cuser->id.'/'.$data['src'].'")   ';
break;

case 'gallery':
$css .= 'url("'.substr(JURI::base(), 0, -1).$this->params->get('gallery_path').'/'.$data['src'].'")   ';
break;

case 'external':
$css .= 'url('.$tmp->src.'")   ';
break;

case '':
break;
}


$repeat = ($data['repeat'])? $data['repeat'] : 'repeat';
$scroll = ($data['attach'])? $data['attach'] : 'scroll';
$hpos = ($data['hpos'])? $data['hpos'] : 'center';
$vpos = ($data['vpos'])? $data['vpos'] : 'center';

if ($css != ' ') {
JFactory::getDocument()->addStyleDeclaration('#'.$this->params->get('div').' {background:'.$css.'; background-position: '.$hpos.' '.$vpos.';background-attachment:'.$scroll.'; background-repeat:'.$repeat.';} div#maincontentTopBG {height:95px;} #maincontentBottomBG {display:none;}');
}
}
if (isset($data['text_color'])) {
$css = (strlen($data['text_color']))? '#'.$data['text_color'].' ' : '';
JFactory::getDocument()->addStyleDeclaration('#'.$this->params->get('div_text').' {color:'.$css.';}');
}
}
}

function onProfileDisplay()
{
$contents = '';
if ( $this->params->get('show_in_appl') && JRequest::getCmd('view') == 'profile' && !JRequest::getCmd('task') && (JFactory::getUser()->id == JRequest::getInt('userid') || !JRequest::getInt('userid')) ) {
ob_start();
echo "
 
<img src=\"".JUri::base()."plugins/community/profdesigner/bg_btn.png\" />
<a onclick=\"Profdesigner.cAppsBackground('".JString::str_ireplace("'", "\\'", JText::_('Change background'))."');\" href=\"javascript:void(0)\">".JText::_('Change background')."</a>
";
echo "
&nbsp;
<img src=\"".JUri::base()."plugins/community/profdesigner/fnt_btn.png\" />
<a onclick=\"Profdesigner.cAppsBackground2('".JString::str_ireplace("'", "\\'", JText::_('Change font color'))."');\" href=\"javascript:void(0)\">".JText::_('Change font color')."</a>";
/*
CFactory::getToolbar()->addItem('PROFILE', 'BACKGROUND_EDIT', JText::_('Change background'), 'Profdesigner.cAppsBackground(\''.JString::str_ireplace("'", "\\'", JText::_('Change background')).'\');', '', true);
CFactory::getToolbar()->addItem('PROFILE', 'COLOR_EDIT', JText::_('Change font color'), 'Profdesigner.cAppsBackground2(\''.JString::str_ireplace("'", "\\'", JText::_('Change font color')).'\');', '', true);
JFactory::getDocument()->addScript(JUri::base(). 'plugins/community/profdesigner/script.js?v3');
*/

$contents = ob_get_contents();
ob_end_clean();
}

return $contents;
}

function ajaxShowBackgrounds($response) {
$data = $this->_getData();

$user =& JFactory::getUser();
if (!$user->id) die;

// image type
$types = array();
$types[] = JHTML::_('select.option', '', JText::_('No image'));
$types[] = JHTML::_('select.option', 'gallery', JText::_('Gallery image'));
$types[] = JHTML::_('select.option', 'upload', JText::_('Custom image'));
$imagesTypes = JHTML::_('select.genericlist', $types, 'type', ' class="inputbox" onchange="Profdesigner.changeImageType(this);"', 'value', 'text', @$data['type']);

// gallery images
$images = array();
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
$files = JFolder::files(JPATH_SITE . $this->params->get('gallery_path'), '(\.jpg)|(\.gif)|(\.png)$', false);

$images[] = JHTML::_('select.option', '', '');
if (isset($files[0])) {
foreach($files as $file) {
$tmp = pathinfo($file);
$images[] = JHTML::_('select.option', $file, ucwords(str_replace('_', ' ', $tmp['filename'])));
}
}
$galleryImages = JHTML::_('select.genericlist', $images, 'gallery', ' class="inputbox" style="width:auto" onchange="Profdesigner.applyImageType();"', 'value', 'text', @$data['src']);

// repeat
if (!@$data['repeat']) $data['repeat'] = 'repeat';
$types = array();
$types[] = JHTML::_('select.option', 'repeat', JText::_('Cascade'));
$types[] = JHTML::_('select.option', 'no-repeat', JText::_('No repeat'));
$types[] = JHTML::_('select.option', 'repeat-x', JText::_('Repeat horizontally'));
$types[] = JHTML::_('select.option', 'repeat-y', JText::_('Repeat vertically'));
$repeat = JHTML::_('select.genericlist', $types, 'repeat', ' class="inputbox" onchange="Profdesigner.applyImageAttr();"', 'value', 'text', $data['repeat']);

// vertical position
if (!@$data['vpos']) $data['vpos'] = 'center';
$types = array();
$types[] = JHTML::_('select.option', 'center', JText::_('Center'));
$types[] = JHTML::_('select.option', 'top', JText::_('Top'));
$types[] = JHTML::_('select.option', 'bottom', JText::_('Bottom'));
$vpos = JHTML::_('select.genericlist', $types, 'vpos', ' class="inputbox" onchange="Profdesigner.applyImageAttr();"', 'value', 'text', $data['vpos']);

// horizontal position
if (!@$data['hpos']) $data['hpos'] = 'center';
$types = array();
$types[] = JHTML::_('select.option', 'center', JText::_('Center'));
$types[] = JHTML::_('select.option', 'left', JText::_('Left'));
$types[] = JHTML::_('select.option', 'right', JText::_('Right'));
$hpos = JHTML::_('select.genericlist', $types, 'hpos', ' class="inputbox" onchange="Profdesigner.applyImageAttr();"', 'value', 'text', $data['hpos']);

// attachment
if (!@$data['attach']) $data['attach'] = 'scroll';
$types = array();
$types[] = JHTML::_('select.option', 'scroll', JText::_('Scroll'));
$types[] = JHTML::_('select.option', 'fixed', JText::_('Fixed'));
$attach = JHTML::_('select.genericlist', $types, 'attach', ' class="inputbox" onchange="Profdesigner.applyImageAttr();"', 'value', 'text', $data['attach']);

ob_start();
?>
<style type="text/css" media="all">
#backgroundForm {
font-size:12px;
}
#backgroundForm table {
border-spacing:none;
border-collapse:separate;
}
#backgroundForm td {
padding:3px;
}
#backgroundForm input.inputbox, #backgroundForm select.inputbox {
border:1px solid #CCCCCC;
margin:0;
padding:3px 5px;
font-size:12px;
}
</style>
<div style="overflow:hidden;">
<iframe id="brkFrame" name="brkFrame" src="" style="display:none"></iframe>
<div id="colorsTable"></div>
<form action="index.php?option=com_community&brkupload=1" id="backgroundForm" name="backgroundForm" enctype="multipart/form-data" target="brkFrame" method="post">
<input type="hidden" name="upload" value="<?php echo @$data['src'];?>" />
<table width="100%" cellpadding="3" cellspacing="0">
<tr valign="top"><td width="1%"><b><?php echo JText::_('Color');?>:</b></td>
<td><input type="text" name="color" value="<?php echo @$data['color'];?>" maxlength="6" class="inputbox" style="width:50px" />
&nbsp;<img src="<?php echo JUri::base();?>/plugins/community/profdesigner/color_wh.png" alt="<?php echo JText::_('Choose color');?>" border="0" align="absmiddle" onclick="Profdesigner.renderColorMap(this.alt);" style="cursor:pointer" />
</td>
</tr>
<tr valign="top"><td><b><?php echo JText::_('Image');?>:</b></td>
<td><?php echo $imagesTypes;?>
<br />
<div id="berkImgallery" style="display:<?php echo (@$data['type']=='gallery')? 'block' : 'none';?>">
<p><?php echo JText::_('Select gallery image');?>: <br /><?php echo $galleryImages;?></p>
</div>
<div id="berkImupload" style="display:<?php echo (@$data['type']=='upload')? 'block' : 'none';?>">
<p id="brkUpFile"><?php echo JText::sprintf('Upload new image (max size is %s)', ini_get('upload_max_filesize'));?>: <br />
<input type="file" class="inputbox" name="Filedata" style="width:210px" />&nbsp;
<input type="button" value="<?php echo JText::_('Upload');?>" class="button" onclick="Profdesigner.uploadImage();" />
</p>
<center id="brkUpWait" style="display:none"><img src="<?php echo JUri::base();?>components/com_community/assets/wait.gif" vspace="10"/></center>
</div>
</td>
</tr>
</table>

<div id="brkImAttrs" style="display:<?php echo (@$data['type'])? 'block' : 'none';?>">
<table width="100%" cellpadding="3" cellspacing="0">
<tr valign="top"><td width="110px"><b><?php echo JText::_('Repeat style');?>:</b></td>
<td><?php echo $repeat;?></td>
</tr>
<tr valign="top"><td><b><?php echo JText::_('Vertical position');?>:</b></td>
<td><?php echo $vpos;?></td>
</tr>
<tr valign="top"><td><b><?php echo JText::_('Horizontal position');?>:</b></td>
<td><?php echo $hpos;?></td>
</tr>
<tr valign="top"><td><b><?php echo JText::_('Scrolling');?>:</b></td>
<td><?php echo $attach;?></td>
</tr>
</table>
</div>
</form>
</div>

<?php
$content = ob_get_contents();
ob_end_clean();
$response->addAssign('cWindowContent' , 'innerHTML' , $content);

$response->addScriptCall('Profdesigner.gallery_path="'.substr(JURI::base(), 0, -1).$this->params->get('gallery_path').'";');
$response->addScriptCall('Profdesigner.upload_path="'.substr(JURI::base(), 0, -1).$this->params->get('upload_path').'/'.$user->id.'";');
$response->addScriptCall('Profdesigner.div="'.$this->params->get('div').'";');
$response->addScriptCall('Profdesigner.base="'.JURI::base().'";');

if (@$data['type']) {
$response->addScriptCall('Profdesigner.changeImageType($(\'backgroundForm\').type);');
}

$buttons = '<form id="brkColBut" style="display:none">';
$buttons .= '<input type="button" value="'.JText::_('Continue').'" class="button" name="Apply" onclick="Profdesigner.hideColorMap();" />';
$buttons .= '</form>';
$buttons .= '<form id="brkUsBut">';
$buttons .= '<input type="button" value="'.JText::_('Save Settings').'" class="button" name="Submit" onclick="Profdesigner.cAppsBackgroundSave();" />';
$buttons .= '&nbsp;';
$buttons .= '<input onclick="cWindowHide();return false;" type="button" value="'.JText::_('Cancel').'" class="button" />';
$buttons .= '</form>';

$response->addScriptCall('cWindowActions', $buttons);
return $response;
}

function ajaxShowBackgrounds2($response) {
$data = $this->_getData();

$user =& JFactory::getUser();
if (!$user->id) die;

ob_start();
?>
<style type="text/css" media="all">
#backgroundForm {
font-size:12px;
}
#backgroundForm table {
border-spacing:none;
border-collapse:separate;
}
#backgroundForm td {
padding:3px;
}
#backgroundForm input.inputbox, #backgroundForm select.inputbox {
border:1px solid #CCCCCC;
margin:0;
padding:3px 5px;
font-size:12px;
}
</style>
<div style="overflow:hidden;">
<iframe id="brkFrame" name="brkFrame" src="" style="display:none"></iframe>
<div id="colorsTable"></div>
<form action="index.php?option=com_community&brkupload=1" id="backgroundForm" name="backgroundForm" enctype="multipart/form-data" target="brkFrame" method="post">
<table width="100%" cellpadding="3" cellspacing="0">
<tr valign="top"><td width="1%"><b><?php echo JText::_('Color');?>:</b></td>
<td><input type="text" name="color" value="<?php echo @$data['text_color'];?>" maxlength="6" class="inputbox" style="width:50px" />
&nbsp;<img src="<?php echo JUri::base();?>/plugins/community/profdesigner/color_wh.png" alt="<?php echo JText::_('Choose color');?>" border="0" align="absmiddle" onclick="Profdesigner.renderColorMap(this.alt);" style="cursor:pointer" />
</td>
</tr>
</table>
</form>
</div>

<?php
$content = ob_get_contents();
ob_end_clean();
$response->addAssign('cWindowContent' , 'innerHTML' , $content);

$response->addScriptCall('Profdesigner.div="'.$this->params->get('div_text').'";');
$response->addScriptCall('Profdesigner.base="'.JURI::base().'";');

$buttons = '<form id="brkColBut" style="display:none">';
$buttons .= '<input type="button" value="'.JText::_('Continue').'" class="button" name="Apply" onclick="Profdesigner.hideColorMap();" />';
$buttons .= '</form>';
$buttons .= '<form id="brkUsBut">';
$buttons .= '<input type="button" value="'.JText::_('Save Settings').'" class="button" name="Submit" onclick="Profdesigner.cAppsBackgroundSave2();" />';
$buttons .= '&nbsp;';
$buttons .= '<input onclick="cWindowHide();return false;" type="button" value="'.JText::_('Cancel').'" class="button" />';
$buttons .= '</form>';

$response->addScriptCall('cWindowActions', $buttons);
return $response;
}


function ajaxSaveBackgrounds($response, $color='', $type='', $gallery='', $repeat='', $vpos='', $hpos='', $upload='', $attach='') {
$response->addAssign('cWindowContent' , 'innerHTML' , '');
$response->addScriptCall('cWindowHide();');

$user =& JFactory::getUser();
$data = $this->_getData();

// check values
if (!$user->id ||
!in_array($type, array('', 'gallery', 'upload')) ||
!in_array($repeat, array('repeat', 'repeat-x', 'repeat-y','no-repeat')) ||
!in_array($vpos, array('center', 'top', 'bottom')) ||
!in_array($hpos, array('center', 'left', 'right')) ||
!in_array($attach, array('scroll', 'fixed'))
) {
return $response;
}

$color = preg_replace('/[^0-9A-Fa-f]/', '', $color);

$db =& JFactory::getDBO();

$row = new stdClass;
$row->user_id = $user->id;
$row->color = $color;
$row->type = $type;
$row->repeat = $repeat;
$row->vpos = $vpos;
$row->hpos = $hpos;
$row->attach = $attach;
$row->text_color = @$data['text_color'];
$row->date = gmdate('Y-m-d H:i:s', time());

if ($type == 'gallery') {
$row->src = $gallery;
}
else if ($type == 'upload') {
$row->src = $upload;
}
else {
$row->src = '';
$row->repeat = '';
$row->vpos = '';
$row->hpos = '';
$row->attach = '';
}

// store new data to log
$db->insertObject('#__community_backgrounds_log', $row);

// save as current data
$fmtsql = 'REPLACE INTO '.$db->nameQuote('#__community_backgrounds').' (%s) VALUES (%s) ';
$fields = array();
foreach (get_object_vars($row) as $k => $v) {
$fields[] = $db->nameQuote($k);
$values[] = $db->isQuoted($k)? $db->Quote($v) : (int) $v;
}
$db->setQuery(sprintf($fmtsql, implode(',', $fields), implode(',', $values)));
$db->query();


// update user's session
$user->JSB_data = array(
'user_id' => $row->user_id,
'color' => $row->color,
'type' => $row->type,
'src' => $row->src,
'repeat' => $row->repeat,
'vpos' => $row->vpos,
'hpos' => $row->hpos,
'attach' => $row->attach,
'text_color' => $row->text_color,
'date' => $row->date
);
JFactory::getSession()->set('user', $user);


return $response;
}

function ajaxSaveBackgrounds2($response, $color='') {
$response->addAssign('cWindowContent' , 'innerHTML' , '');
$response->addScriptCall('cWindowHide();');

$user =& JFactory::getUser();
$data = $this->_getData();

// check values
if (!$user->id) {
return $response;
}

$color = preg_replace('/[^0-9A-Fa-f]/', '', $color);

$db =& JFactory::getDBO();

$row = new stdClass;
$row->user_id = $user->id;
$row->color = @$data['color'];
$row->type = @$data['type'];
$row->repeat = @$data['repeat'];
$row->vpos = @$data['vpos'];
$row->hpos = @$data['hpos'];
$row->attach = @$data['attach'];
$row->text_color = $color;
$row->date = gmdate('Y-m-d H:i:s', time());
$row->src = @$data['src'];

// store new data to log
$db->insertObject('#__community_backgrounds_log', $row);

// save as current data
$fmtsql = 'REPLACE INTO '.$db->nameQuote('#__community_backgrounds').' (%s) VALUES (%s) ';
$fields = array();
foreach (get_object_vars($row) as $k => $v) {
$fields[] = $db->nameQuote($k);
$values[] = $db->isQuoted($k)? $db->Quote($v) : (int) $v;
}
$db->setQuery(sprintf($fmtsql, implode(',', $fields), implode(',', $values)));
$db->query();


// update user's session
$user->JSB_data = array(
'user_id' => $row->user_id,
'color' => $row->color,
'type' => $row->type,
'src' => $row->src,
'repeat' => $row->repeat,
'vpos' => $row->vpos,
'hpos' => $row->hpos,
'attach' => $row->attach,
'text_color' => $row->text_color,
'date' => $row->date
);
JFactory::getSession()->set('user', $user);


return $response;
}

function _getData() {
$user =& JFactory::getUser();
$cuser =& CFactory::getActiveProfile();
$data = false;

// we have cached data for this user?
if (isset($user->JSB_data['user_id'])&&$this->params->get('cache')) {
$data = ($user->JSB_data['user_id'] == $cuser->id)? $user->JSB_data : false;
if (strtotime(gmdate('Y-m-d H:i:s', time())) - strtotime($user->JSB_data['date']) > 5*60) { // expire in 5 mins
$data = false;
}
}
if (!isset($data['user_id'])) {
$db =& JFactory::getDBO();
$db->setQuery('SELECT *, text_color FROM #__community_backgrounds WHERE user_id='.$db->quote($cuser->id), 0, 1);
$data = $db->loadAssoc();

// create tables
if ($db->getErrorNum() == 1146 || $db->getErrorNum() == 1054) {
$query = file_get_contents(JPATH_SITE.DS.'plugins'.DS.'community'.DS.'profdesigner'.DS.'sql.sql');
$db->setQuery($query);
$db->queryBatch();
}

// fake data
if (!isset($data['user_id'])) {
$data = array('user_id'=>$cuser->id);
}
// reset session data
$user->JSB_data = $data;
$user->JSB_data['date'] = gmdate('Y-m-d H:i:s', time());
JFactory::getSession()->set('user', $user);
}
return $data;
}

function _upload() {
$user =& JFactory::getUser();
if (!$user->id) die();

$file = JRequest::getVar('Filedata', '', 'files', 'array');
$err = false;

// Set FTP credentials, if given
jimport('joomla.client.helper');
JClientHelper::setCredentialsFromRequest('ftp');

// Make the filename safe
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
$file['name'] = JFile::makeSafe($file['name']);

if (isset($file['name'])) {
// check file
if (!strlen($file['name'])) {
$err = 'Please select file for upload!';
}
// check file type
else {
$ext = strtolower(JFile::getExt($file['name']));
if (!in_array($ext, array('jpg', 'jpeg', 'gif', 'png'))) {
$err = 'This file type is not supported, please upload .GIF or .JPG or .PNG file!';
}
}

if ($err != false) {?>
<script type="text/javascript">
window.parent.$('brkUpWait').style.display = 'none';
window.parent.$('brkUpFile').style.display = 'block';
alert('<?php echo JString::str_ireplace("'", "\\'", JText::_($err));?>');
</script>
<?php
jexit();
}


// check folder
$folder = JPATH_SITE . $this->params->get('upload_path'). DS . $user->id;

if (!file_exists($folder)) {
if (!JFolder::create($folder, 0757)) {?>
<script type="text/javascript">
window.parent.$('brkUpWait').style.display = 'none';
window.parent.$('brkUpFile').style.display = 'block';
alert('<?php echo JString::str_ireplace("'", "\\'", JText::_('Can\'t create folder, please contact site administrator!'));?>');
</script>
<?php
jexit();
}
file_put_contents($folder.DS.'index.html', '<html><body bgcolor="#FFFFFF"></body></html>');
}

$filepath = JPath::clean($folder . DS . strtolower($file['name']));

if (file_exists($filepath)) {
@unlink($filepath);
}

if (!JFile::upload($file['tmp_name'], $filepath)) {?>
<script type="text/javascript">
window.parent.$('brkUpWait').style.display = 'none';
window.parent.$('brkUpFile').style.display = 'block';
alert('<?php echo JString::str_ireplace("'", "\\'", JText::_('Can\'t upload file, please contact site administrator!'));?>');
</script>
<?php
exit();
} else {
// resize
list($sw, $sh, $type) = getimagesize($filepath);
$max_width = $this->params->get('max_width');

if ($sw > $max_width) {
$com = 'convert -size '.$sw.'x'.$sh.' "'.$filepath.'" -thumbnail '.$max_width.'x'.$max_width.' -quality 95 "'.$filepath.'"';
@exec($com, $output, $status);
}

?>
<script type="text/javascript">
window.parent.$('brkUpWait').style.display = 'none';
window.parent.$('brkUpFile').style.display = 'block';
window.parent.$('backgroundForm').upload.value = '<?php echo strtolower($file['name']);?>';
window.parent.Profdesigner.applyImageType();
</script>
<?php
exit();
}
}
}

function ajaxRedrawImages($response) {
$this->_ajax = true;
$response->addAssign('brkimgapp' , 'innerHTML' , $this->onProfileDisplay());
$response->addScriptCall('Lightbox.init();');
return $response;
}
}
}
« Последнее редактирование: 27.12.2012, 17:54:33 от Сergei »
*

Сergei

  • Захожу иногда
  • 189
  • 0 / 0
« Последнее редактирование: 25.04.2013, 10:01:08 от Сergei »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Система баллов на сайте

Автор mila_serdnaya

Ответов: 153
Просмотров: 18134
Последний ответ 21.03.2016, 01:33:44
от mila_serdnaya
Правило AlphaUserPoints 1.8.9 снятие баллов за продление объявления в AdsManager 2.9.13

Автор Ishti39

Ответов: 34
Просмотров: 8271
Последний ответ 08.01.2016, 17:12:10
от Ishti39
Начисление баллов за вступление вгруппу

Автор Dusk09

Ответов: 0
Просмотров: 1789
Последний ответ 11.08.2015, 23:58:23
от Dusk09
При начислении баллов исчезает группа пользователей

Автор Yavich

Ответов: 6
Просмотров: 3242
Последний ответ 09.03.2015, 16:03:10
от hazyin
Как сделать так, чтобы аватарка при загрузке обрезалась по размеру?

Автор NlCK

Ответов: 2
Просмотров: 2539
Последний ответ 21.05.2014, 13:31:37
от NlCK