当前位置: 首页>>代码示例>>PHP>>正文


PHP acymailing::bytes方法代码示例

本文整理汇总了PHP中acymailing::bytes方法的典型用法代码示例。如果您正苦于以下问题:PHP acymailing::bytes方法的具体用法?PHP acymailing::bytes怎么用?PHP acymailing::bytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在acymailing的用法示例。


在下文中一共展示了acymailing::bytes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: increasePerf

 function increasePerf()
 {
     if (acymailing::bytes(@ini_get('memory_limit')) < 60000000) {
         @ini_set('memory_limit', '64M');
     }
     @ini_set('max_execution_time', 0);
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:7,代码来源:helper.php

示例2: form

    function form()
    {
        $mailid = acymailing::getCID('mailid');
        $templateClass = acymailing::get('class.template');
        $config =& acymailing::config();
        if (!empty($mailid)) {
            $mailClass = acymailing::get('class.mail');
            $mail = $mailClass->get($mailid);
            if (!empty($mail->tempid)) {
                $myTemplate = $templateClass->get($mail->tempid);
            }
        } else {
            $mail->created = time();
            $mail->published = 0;
            $mail->visible = 1;
            $mail->html = 1;
            $mail->body = '';
            $mail->altbody = '';
            $mail->tempid = 0;
            $myTemplate = $templateClass->getDefault();
            if (!empty($myTemplate->tempid)) {
                $mail->body = acymailing::absoluteURL($myTemplate->body);
                $mail->altbody = $myTemplate->altbody;
                $mail->tempid = $myTemplate->tempid;
                $mail->subject = $myTemplate->subject;
                $mail->replyname = $myTemplate->replyname;
                $mail->replyemail = $myTemplate->replyemail;
                $mail->fromname = $myTemplate->fromname;
                $mail->fromemail = $myTemplate->fromemail;
            }
            if ($this->type == 'autonews') {
                $mail->frequency = 604800;
            }
        }
        $sentbyname = '';
        if (!empty($mail->sentby)) {
            $db =& JFactory::getDBO();
            $db->setQuery('SELECT `name` FROM `#__users` WHERE `id`= ' . intval($mail->sentby) . ' LIMIT 1');
            $sentbyname = $db->loadResult();
        }
        $this->assignRef('sentbyname', $sentbyname);
        if (JRequest::getVar('task', '') == 'replacetags') {
            $mailerHelper = acymailing::get('helper.mailer');
            JPluginHelper::importPlugin('acymailing');
            $dispatcher =& JDispatcher::getInstance();
            $dispatcher->trigger('acymailing_replacetags', array(&$mail));
            if (!empty($mail->altbody)) {
                $mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
            }
        }
        $extraInfos = '';
        $values = null;
        if ($this->type == 'followup') {
            $campaignid = JRequest::getInt('campaign', 0);
            $extraInfos .= '&campaign=' . $campaignid;
            $values->delay = acymailing::get('type.delay');
            $this->assignRef('campaignid', $campaignid);
        } else {
            $listmailClass = acymailing::get('class.listmail');
            $lists = $listmailClass->getLists($mailid);
        }
        acymailing::setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=edit&mailid=' . $mailid . $extraInfos);
        $bar =& JToolBar::getInstance('toolbar');
        if (empty($mail->mailid)) {
            $bar->appendButton('Popup', 'acytemplate', JText::_('TEMPLATE'), acymailing::completeLink("template&task=theme", true));
        }
        $bar->appendButton('Popup', 'tag', JText::_('TAGS'), acymailing::completeLink("tag&task=tag&type=" . $this->type, true), 750, 550);
        if (in_array($this->type, array('news', 'followup'))) {
            JToolBarHelper::custom('replacetags', 'replacetag', '', JText::_('REPLACE_TAGS'), false);
        }
        $buttonPreview = JText::_('PREVIEW');
        if ($this->type == 'news') {
            $buttonPreview .= ' / ' . JText::_('SEND');
        }
        JToolBarHelper::divider();
        JToolBarHelper::custom('savepreview', 'preview', '', $buttonPreview, false);
        JToolBarHelper::save();
        JToolBarHelper::apply();
        JToolBarHelper::cancel();
        JToolBarHelper::divider();
        $bar->appendButton('Pophelp', $this->ctrl . '-form');
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        $values->maxupload = acymailing::bytes(ini_get('upload_max_filesize')) > acymailing::bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing::get('helper.toggle');
        $editor = acymailing::get('helper.editor');
        $editor->name = 'editor_body';
        $editor->content = $mail->body;
        $js = "function updateEditor(htmlvalue){";
        $js .= 'if(htmlvalue == \'0\'){window.document.getElementById("htmlfieldset").style.display = \'none\'}else{window.document.getElementById("htmlfieldset").style.display = \'block\'}';
        $js .= '}';
        $js .= 'window.addEvent(\'load\', function(){ updateEditor(' . $mail->html . '); });';
        $script = 'function addFileLoader(){
		var divfile=window.document.getElementById("loadfile");
		var input = document.createElement(\'input\');
		input.type = \'file\';
		input.size = \'30\';
		input.name = \'attachments[]\';
		divfile.appendChild(document.createElement(\'br\'));
		divfile.appendChild(input);}
//.........这里部分代码省略.........
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:101,代码来源:view.html.php

示例3: defined

 */
defined('_JEXEC') or die('Restricted access');
?>

<table class="admintable" cellspacing="1">
	<tr>
		<td class="key" >
			<?php 
echo JText::_('UPLOAD_FILE');
?>

		</td>
		<td>
			<input type="file" size="50" name="importfile" />
			<?php 
echo JText::sprintf('MAX_UPLOAD', acymailing::bytes(ini_get('upload_max_filesize')) > acymailing::bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize'));
?>

		</td>
	</tr>
	<tr>
		<td class="key" >
			<?php 
echo JText::_('CHARSET_FILE');
?>

		</td>
		<td>
			<?php 
$charsetType = acymailing::get('type.charset');
array_unshift($charsetType->values, JHTML::_('select.option', JText::_('UNKNOWN'), ''));
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:31,代码来源:file.php

示例4: form

    function form()
    {
        JHTML::_('behavior.mootools');
        $mailid = acymailing::getCID('mailid');
        if (empty($mailid)) {
            $mailid = JRequest::getString('mailid');
        }
        $mailClass = acymailing::get('class.mail');
        $mail = $mailClass->get($mailid);
        if (empty($mail)) {
            $config =& acymailing::config();
            $mail->created = time();
            $mail->fromname = $config->get('from_name');
            $mail->fromemail = $config->get('from_email');
            $mail->replyname = $config->get('reply_name');
            $mail->replyemail = $config->get('reply_email');
            $mail->subject = '';
            $mail->type = JRequest::getString('type');
            $mail->published = 1;
            $mail->visible = 0;
            $mail->html = 1;
            $mail->body = '';
            $mail->altbody = '';
            $mail->tempid = 0;
        }
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        $values = null;
        $values->maxupload = acymailing::bytes(ini_get('upload_max_filesize')) > acymailing::bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing::get('helper.toggle');
        $editor = acymailing::get('helper.editor');
        $editor->name = 'editor_body';
        $editor->content = $mail->body;
        $js = "function updateAcyEditor(htmlvalue){";
        $js .= 'if(htmlvalue == \'0\'){window.document.getElementById("htmlfieldset").style.display = \'none\'}else{window.document.getElementById("htmlfieldset").style.display = \'block\'}';
        $js .= '}';
        $js .= 'window.addEvent(\'load\', function(){ updateAcyEditor(' . $mail->html . '); });';
        $script = 'function addFileLoader(){
		var divfile=window.document.getElementById("loadfile");
		var input = document.createElement(\'input\');
		input.type = \'file\';
		input.size = \'30\';
		input.name = \'attachments[]\';
		divfile.appendChild(document.createElement(\'br\'));
		divfile.appendChild(input);}
		';
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $script .= 'function submitbutton(pressbutton){
						if (pressbutton == \'cancel\') {
							submitform( pressbutton );
							return;
						}';
        } else {
            $script .= 'Joomla.submitbutton = function(pressbutton) {
						if (pressbutton == \'cancel\') {
							Joomla.submitform(pressbutton,document.adminForm);
							return;
						}';
        }
        $script .= 'if(window.document.getElementById("subject").value.length < 2){alert(\'' . JText::_('ENTER_SUBJECT', true) . '\'); return false;}';
        $script .= $editor->jsCode();
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $script .= 'submitform( pressbutton );} ';
        } else {
            $script .= 'Joomla.submitform(pressbutton,document.adminForm);}; ';
        }
        $script .= "function insertTag(tag){ try{jInsertEditorText(tag,'editor_body'); document.getElementById('iframetag').style.display = 'none'; displayTags(); return true;} catch(err){alert('Your editor does not enable AcyMailing to automatically insert the tag, please copy/paste it manually in your Newsletter'); return false;}}";
        $iFrame = "'<iframe src=\\'index.php?option=com_acymailing&ctrl=tag&task=tag&type=news\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
        $script .= "var openTag = true;\r\n\t\t\t\t\tfunction displayTags(){var box=\$('iframetag'); if(openTag){box.innerHTML = " . $iFrame . "; box.setStyle('display','block');}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tvar fx = box.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut});\r\n\t\t\t\t\t\tif(openTag){fx.start({'height': 300});}else{fx.start({'height': 0}).chain(function() {box.innerHTML = '';box.setStyle('display','none');})};\r\n\t\t\t\t\t}catch(err){\r\n\t\t\t\t\t\tbox.style.height = '300px';\r\n\t\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframetag');\r\n\t\t\t\t\t\tif(openTag){\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideIn();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\r\n\t\t\t\t\t\t\t\tbox.innerHTML='';\r\n\t\t\t\t\t\t\t\tbox.setStyle('display','none');\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\topenTag = !openTag;}";
        $iFrame = "'<iframe src=\\'index.php?option=com_acymailing&ctrl=template&task=theme&tmpl=component\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
        $script .= "var openTemplate = true;\r\n\t\t\t\t\tfunction displayTemplates(){var box=\$('iframetemplate'); if(openTemplate){box.innerHTML = " . $iFrame . "; box.setStyle('display','block');}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tvar fx = box.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut});\r\n\t\t\t\t\t\tif(openTemplate){fx.start({'height': 300});}else{fx.start({'height': 0}).chain(function() {box.innerHTML = '';box.setStyle('display','none');})};\r\n\t\t\t\t\t}catch(err){\r\n\t\t\t\t\t\tbox.style.height = '300px';\r\n\t\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframetemplate');\r\n\t\t\t\t\t\tif(openTemplate){\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideIn();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\r\n\t\t\t\t\t\t\t\tbox.innerHTML='';\r\n\t\t\t\t\t\t\t\tbox.setStyle('display','none');\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\topenTemplate = !openTemplate;}";
        $script .= "function changeTemplate(newhtml,newtext,newsubject,stylesheet,fromname,fromemail,replyname,replyemail,tempid){\r\n\t\t\tif(newhtml.length>2){" . $editor->setContent('newhtml') . "}\r\n\t\t\tvar vartextarea =\$('altbody'); if(newtext.length>2) vartextarea.innerHTML = newtext;\r\n\t\t\tdocument.getElementById('tempid').value = tempid;\r\n\t\t\tif(fromname.length>1){document.getElementById('fromname').value = fromname;}\r\n\t\t\tif(fromemail.length>1){document.getElementById('fromemail').value = fromemail;}\r\n\t\t\tif(replyname.length>1){document.getElementById('replyname').value = replyname;}\r\n\t\t\tif(replyemail.length>1){document.getElementById('replyemail').value = replyemail;}\r\n\t\t\tif(newsubject.length>1){document.getElementById('subject').value = newsubject;}\r\n\t\t\tdocument.getElementById('iframetemplate').style.display = 'none'; displayTemplates();\r\n\t\t}\r\n\t\t";
        $doc =& JFactory::getDocument();
        $doc->addScriptDeclaration($js . $script);
        $doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css');
        $this->assignRef('toggleClass', $toggleClass);
        $this->assignRef('editor', $editor);
        $this->assignRef('values', $values);
        $this->assignRef('mail', $mail);
        $this->assignRef('tabs', $tabs);
    }
开发者ID:bizanto,项目名称:Hooked,代码行数:81,代码来源:view.html.php

示例5: form

    function form()
    {
        JHTML::_('behavior.modal', 'a.modal');
        $templateClass = acymailing::get('class.template');
        $mailid = acymailing::getCID('mailid');
        $my = JFactory::getUser();
        if (!empty($mailid)) {
            $mailClass = acymailing::get('class.mail');
            $mail = $mailClass->get($mailid);
            if (!empty($mail->tempid)) {
                $myTemplate = $templateClass->get($mail->tempid);
            }
        } else {
            $config =& acymailing::config();
            $mail->created = time();
            $mail->published = 0;
            $mail->visible = 1;
            $mail->html = 1;
            $mail->body = '';
            $mail->altbody = '';
            $mail->tempid = 0;
            $myTemplate = $templateClass->getDefault();
            if (!empty($myTemplate->tempid)) {
                $mail->body = $myTemplate->body;
                $mail->altbody = $myTemplate->altbody;
                $mail->tempid = $myTemplate->tempid;
                $mail->subject = $myTemplate->subject;
                $mail->replyname = $myTemplate->replyname;
                $mail->replyemail = $myTemplate->replyemail;
                $mail->fromname = $myTemplate->fromname;
                $mail->fromemail = $myTemplate->fromemail;
            }
            if ($config->get('frontend_sender', 0)) {
                $mail->fromname = $my->name;
                $mail->fromemail = $my->email;
            } else {
                if (empty($mail->fromname)) {
                    $mail->fromname = $config->get('from_name');
                }
                if (empty($mail->fromemail)) {
                    $mail->fromemail = $config->get('from_email');
                }
            }
            if ($config->get('frontend_reply', 0)) {
                $mail->replyname = $my->name;
                $mail->replyemail = $my->email;
            } else {
                if (empty($mail->replyname)) {
                    $mail->replyname = $config->get('reply_name');
                }
                if (empty($mail->replyemail)) {
                    $mail->replyemail = $config->get('reply_email');
                }
            }
        }
        $sentbyname = '';
        if (!empty($mail->sentby)) {
            $db =& JFactory::getDBO();
            $db->setQuery('SELECT `name` FROM `#__users` WHERE `id`= ' . intval($mail->sentby) . ' LIMIT 1');
            $sentbyname = $db->loadResult();
        }
        $this->assignRef('sentbyname', $sentbyname);
        if (JRequest::getVar('task', '') == 'replacetags') {
            $mailerHelper = acymailing::get('helper.mailer');
            JPluginHelper::importPlugin('acymailing');
            $dispatcher =& JDispatcher::getInstance();
            $dispatcher->trigger('acymailing_replacetags', array(&$mail));
            if (!empty($mail->altbody)) {
                $mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
            }
        }
        $values = null;
        $listmailClass = acymailing::get('class.listmail');
        $lists = $listmailClass->getLists($mailid);
        $copyAllLists = $lists;
        foreach ($copyAllLists as $listid => $oneList) {
            if (!$oneList->published or empty($my->id) or empty($my->gid)) {
                unset($lists[$listid]);
                continue;
            }
            if ($oneList->access_manage == 'all') {
                continue;
            }
            if ((int) $my->id == (int) $oneList->userid) {
                continue;
            }
            if (!in_array($my->gid, explode(',', $oneList->access_manage))) {
                unset($lists[$listid]);
                continue;
            }
        }
        if (empty($lists)) {
            $app =& JFactory::getApplication();
            $app->enqueueMessage('You don\'t have the rights to add or edit an e-mail', 'error');
            $app->redirect(acymailing::completeLink('lists', false, true));
        }
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        $values->maxupload = acymailing::bytes(ini_get('upload_max_filesize')) > acymailing::bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing::get('helper.toggle');
//.........这里部分代码省略.........
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:101,代码来源:view.html.php


注:本文中的acymailing::bytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。