Esempio n. 1
0
function __mobile_truncate_content($i)
{
    $ml = rss_theme_config_override_option('rss.output.maxlength', DEFAULT_MOBILE_OUTPUT_MAXLENGTH);
    if ($ml) {
        $i->description = html_substr($i->description, $ml);
    }
    return $i;
}
Esempio n. 2
0
function xoops_module_update_ilog(&$module)
{
    global $xoopsDB;
    $query = "ALTER TABLE `" . $xoopsDB->prefix("ilog_article") . "`  ADD `dohtml` tinyint( 1 ) UNSIGNED NOT NULL DEFAULT '1';";
    $xoopsDB->queryF($query);
    $handler =& xoops_getmodulehandler('article', 'ilog');
    $articles = $handler->getAll(null, array('id'), false, true);
    include_once dirname(__FILE__) . "/function.php";
    foreach (array_keys($articles) as $k) {
        $obj =& $handler->get($k);
        $contentSubStr = html_substr($obj->getVar("text_body"), 400);
        if ($contentSubStr) {
            $obj->setVar('summary', $contentSubStr);
        } else {
            $obj->setVar('summary', $obj->getVar("text_body"));
        }
        $obj->setVar('text_body', $obj->getVar("text_body"));
        $handler->insert($obj);
        unset($obj);
    }
    return true;
}
            $query = "SELECT SUBKEY, value FROM {$board[$i]['nome']}_conf WHERE `GROUP` = 'FORUM' AND FKEY ='DATA' AND PRESENT ='1' ";
            $result = $db->get_results($query);
            if ($result) {
                foreach ($result as $row) {
                    $board_conf[$row->SUBKEY] = $row->value;
                }
            }
            $to_show[] = array('num' => $i + 1, 'nome' => $board[$i]['nome'], 'bind' => $bind, 'porta' => $config['WEBSERVER'][$board[$i]['nome']]['PORTA'], 'pkey' => $board[$i]['pkey'], 'conf' => $board_conf);
        }
    }
}
if ($to_show) {
    foreach ($to_show as $key => $array) {
        $nota_estesa = secure_v($array['conf']['NOTE']);
        if (strlen($nota_estesa) > 100) {
            $nota_taglio = html_substr($nota_estesa, 70);
        }
        echo "\r\n\t<tr>\r\n\t<td class='row1' align='center'>{$array['num']}</td>\r\n\t<td class='row2' align='left'><a target='_blank' href='http://{$array['bind']}:{$array['porta']}'>{$array['nome']}</a></td>\r\n\t<!-- <td class='row2' align='center'>{$bind}</td>\r\n\t<td class='row2' align='center'>{$array['porta']}</td>-->\r\n\t<td class='row2' align='center'>{$array['conf']['NAME']}</td>\r\n\t<td class='row2' align='center'>{$array['conf']['ADMIN_NAME']}</td>\r\n\t<td class='row2' >" . convert(secure_v($array['conf']['DESCRIZIONE'])) . "</td>\t\r\n\t<td class='row2' ><p title='{$nota_estesa}'>{$nota_taglio}...</td>\t\t\r\n\t<!-- Problemi di layout: <td class='row2' >\r\n\t\t<textarea name='chiave' cols='1' rows='3' readonly class='row2' style='width:100%;border: none;overflow:auto;'>{$array['pkey']}</textarea></td>\n--> \r\n\t</tr>";
    }
}
?>
  </table>
</div>

<?php 
PageSelect();
?>

 </td>
</tr>
<?php 
Esempio n. 4
0
 protected function html_substr($text, $length, $ending = '...', $exact = TRUE, $consider_html = FALSE)
 {
     if (defined('STRICT_TYPES') && CAMEL_CASE == '1') {
         return (string) self::parameters(['text' => DT::TEXT, 'length' => DT::UINT8, 'ending' => DT::STRING, 'exact' => DT::BOOL, 'consider_html' => DT::BOOL])->call(__FUNCTION__)->with($text, $length, $ending, $exact, $consider_html)->returning(DT::TEXT);
     } else {
         return (string) html_substr($text, $length, $ending, $exact, $consider_html);
     }
 }
Esempio n. 5
0
 case "save":
     if (!$GLOBALS['xoopsSecurity']->check()) {
         redirect_header('index.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
     }
     if (isset($_REQUEST['id'])) {
         $obj =& $handler->get($_REQUEST['id']);
         $obj->setVar('summary', $_REQUEST["summary"]);
     } else {
         $obj =& $handler->create();
         $obj->setVar('uid', $_REQUEST['uid']);
         $obj->setVar('uname', $_REQUEST['uname']);
         $obj->setVar("time_create", time());
         $obj->setVar("time_publish", time());
         global $xoopsModuleConfig;
         $summary = trim(strip_tags($_REQUEST["summary"]));
         if (empty($summary) && ($contentSubStr = html_substr($_REQUEST["text_body"], $xoopsModuleConfig['summary']))) {
             $obj->setVar('summary', $contentSubStr);
         } else {
             $obj->setVar('summary', $_REQUEST["summary"]);
         }
     }
     $obj->setVar('status', $_REQUEST['status']);
     $obj->setVar('keywords', $_REQUEST['keywords']);
     $obj->setVar('title', $_REQUEST['title']);
     $obj->setVar('text_body', $_REQUEST['text_body']);
     if ($handler->insert($obj)) {
         $tag_handler = xoops_getmodulehandler('tag', 'tag');
         $itemid = $obj->getVar('id');
         $tag_handler->updateByItem($_POST["keywords"], $itemid, $xoopsModule->getVar("dirname"), $catid = 0);
         redirect_header('index.php', 3, sprintf(_MD_GUESTBOOK_SAVEDSUCCESS));
     }