Displaying 261-270 of 276 results.
Resolved: Yii - How to customize a CGridView CbuttonColumn
posted by admin on December 25, 2015
Customize default buttons? :(Read more
Resolved: Convert seconds to Hour:Minute:Second
posted by admin on December 22, 2015
I need to convert seconds to Hour:Minute:Second.

For example: 685 converted to 00:11:25

How can I achieve this?Read more
Resolved: Displaying preview panel automatically in markitup! editor
posted by admin on December 22, 2015
I'm using the markitup! as a markdown editor (example).

Currently, I need to press the preview button (green tick) to display the preview panel.

I would like the preview to be displayed automatically - how can I achieve this?Read more
Resolved: Проблема с кодировкой заголовков в функции mail.ru
posted by admin on December 25, 2015
в письмах почему то не приходят заголовки на русском языке, на английском-приходят

<?php
$mailto = "benderbej@mail.ru";
$charset = "utf-8";
$subject = "Обратная связь";
$content = "text/plain";
$status = " ";

$errors_name = 'введите ваше имя';
$errors_mailfrom = 'введите свой E-mail';
$errors_incorrect = 'заполните правильно Ваш E-mail';
$errors_message = 'наберите сообщение';
$send = 'ваше письмо отправлено!';

if (isset($name) && $name == "")
{
$status = "$errors_name";
}
elseif (isset($mailfrom) && $mailfrom == "")
{
$status = "errors_mailfrom";
}
elseif(isset($mailfrom) && !eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$",$mailfrom))
//elseif(isset($mailfrom) && !preg_match("/^([a-z,._,0-9])+@([a-z,._,0-9])+(.(
//[a-z])+)+$/",$mailfrom))
{
$status = "$errors_incorrect";
unset($mailfrom);
}
elseif (isset($message) && $message == "")
{
$status = "errors_message";
}
elseif (!empty($_POST))
{
$subject = substr(htmlspecialchars(trim($_POST['subject'])), 0, 1000);
$message = substr(htmlspecialchars(trim($_POST['message'])), 0, 1000000);
$name = substr(htmlspecialchars(trim($_POST['name'])), 0, 30);
$headers = "MIME-Version: 1.0\r\n";
$headers .="Content-Type: $content charset=$charset\r\n";
$headers .= "Date: ".date("Y-m-d (H:i:s)",time())."\r\n";
$headers .= "From: \"$name\"<$mailfrom>\r\n";
$headers .= "X-Mailer: My Send E-mail\r\n";
mail("$mailto","$subject","$message","$headers");
unset($name, $mailfrom, $mailto, $subject, $message);
$status = "$send";
}

в чем дело?
пробовал менять на

$charset = "Windows-1251";
Read more
Resolved: How to get URL of current page in PHP
posted by admin on December 25, 2015
How to get URL of current page in PHP?Read more
Resolved: Русский текст в транслит на PHP(Rus to Lat)
posted by admin on December 25, 2015
The last segment is actually the friendly title of the blog article. The problem is when I try to pass that segment to the database, the cyrillic fonts turn into something like %D1%8A%D0%B4%D1%80%D0%BE%D1%81%D1%8 and couldn't match the database record. In the address bar in my browser it looks normal (мъдростта-на-вековете) but if I choose 'copy url location' the last segment again turns into these strange characters.

Please help to convert cyrillic to english letters(lat)Read more
Resolved: Yii 1.1: syntaxhighlighter extension CListView ajax pagination problem
posted by admin on December 25, 2015
CListView ajax pagination Can't find XML Brush etc.
First page working great, but when working ajax pagination, brushes not working, not finding any brushes.

My code:

<?php Yii::app()->syntaxhighlighter->addHighlighter(); ?>
Read more
Resolved: How To Set The "pagevar" Parameter For The Grid View Widget?
posted by admin on December 25, 2015
Hi,
I have a gridview widget:

$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider' => $model->search(),
'summaryText' => 'صفحه {page} از مجموع {pages} صفحه',
'enableSorting' => false,
'enablePagination' => true,
'ajaxUpdate' => false,
'columns'=>array(
//....
),
));


In the pagination links it includes the model name as prefix to pageVar parameter. is there anyway to set the pageVar property of widget so it changes the links from "index.php?r=item/list&Items_page=2" to "index.php?r=item/list&page=2" ?Read more
Resolved: MarkItUp emotions smileys click insert to editor javascript jquery
posted by admin on December 25, 2015
altHow to insert markitup smileys to markitup editor.

<div id="emoticons">
<a href="#" alt="EMOTION_CODE">
<img alt="EMOTION_CODE" src="EMOTION_IMG">
</a>
<a href="#" alt="EMOTION_CODE">
<img alt="EMOTION_CODE" src="EMOTION_IMG">
</a>
<a href="#" alt="EMOTION_CODE">
<img alt="EMOTION_CODE" src="EMOTION_IMG">
</a>
etc
</div>
Read more
Resolved: Syntaxhighlighter can't find any brushes after ajax request
posted by admin on December 25, 2015
After implementing pagination on my website, I was not able to highlight the code with SyntaxHighliter plugin. After AJAX call script was throwing an error: "Can't find brush for: BRUSH".Read more