本文整理汇总了PHP中paragraph函数的典型用法代码示例。如果您正苦于以下问题:PHP paragraph函数的具体用法?PHP paragraph怎么用?PHP paragraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了paragraph函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Standard modular run function.
*
* @return tempcode Results
*/
function run()
{
$out = new ocp_tempcode();
$tables = $GLOBALS['SITE_DB']->query_select('db_meta', array('DISTINCT m_table'));
if (count($GLOBALS['SITE_DB']->connection_write) > 4) {
$GLOBALS['SITE_DB']->connection_write = call_user_func_array(array($GLOBALS['SITE_DB']->static_ob, 'db_get_connection'), $GLOBALS['SITE_DB']->connection_write);
_general_db_init();
}
list($db, $db_name) = $GLOBALS['SITE_DB']->connection_write;
mysql_select_db($db_name, $db);
foreach ($tables as $table) {
if ($table['m_table'] == 'sessions') {
continue;
}
// HEAP, so can't be repaired
$table = get_table_prefix() . $table['m_table'];
// Check/Repair
$result = mysql_query('CHECK TABLE ' . $table . ' FAST', $db);
echo mysql_error($db);
mysql_data_seek($result, mysql_num_rows($result) - 1);
$status_row = mysql_fetch_assoc($result);
if ($status_row['Msg_type'] != 'status') {
$out->attach(paragraph(do_lang_tempcode('TABLE_ERROR', escape_html($table), escape_html($status_row['Msg_type']), array(escape_html($status_row['Msg_text']))), 'dfsdgdsgfgd'));
$result2 = mysql_query('REPAIR TABLE ' . $table, $db);
mysql_data_seek($result2, mysql_num_rows($result2) - 1);
$status_row_2 = mysql_fetch_assoc($result2);
$out->attach(paragraph(do_lang_tempcode('TABLE_FIXED', escape_html($table), escape_html($status_row_2['Msg_type']), array(escape_html($status_row_2['Msg_text']))), 'dfsdfgdst4'));
}
// Optimise
mysql_unbuffered_query('OPTIMIZE TABLE ' . $table, $db);
}
return $out;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:mysql.php
示例2: run
/**
* Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
*
* @return tempcode The snippet
*/
function run()
{
$sup = get_param('block_map_sup', '', true);
$_map = get_param('block_map', false, true);
if ($sup != '') {
$_map .= ',' . $sup;
}
require_code('blocks');
$map = block_params_str_to_arr($_map);
if (!array_key_exists('block', $map)) {
return new ocp_tempcode();
}
$auth_key = get_param_integer('auth_key');
// Check permissions
$test = $GLOBALS['SITE_DB']->query_value_null_ok('temp_block_permissions', 'p_block_constraints', array('p_session_id' => get_session_id(), 'id' => $auth_key));
if (is_null($test) || !block_signature_check(block_params_str_to_arr($test), $map)) {
require_lang('permissions');
return paragraph(do_lang_tempcode('ACCESS_DENIED__ACCESS_DENIED', escape_html($map['block'])));
}
// Cleanup
$GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'temp_block_permissions WHERE p_time<' . strval(time() - 60 * 60 * intval(get_option('session_expiry_time'))));
// Return block snippet
global $CSSS, $JAVASCRIPTS;
$CSSS = array();
$JAVASCRIPTS = array();
$out = new ocp_tempcode();
$out->attach(symbol_tempcode('CSS_TEMPCODE'));
$out->attach(symbol_tempcode('JS_TEMPCODE'));
$out->attach(do_block($map['block'], $map));
return $out;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:block.php
示例3: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
$url = array_key_exists('param', $map) ? $map['param'] : 'http://ocportal.com/backend.php?type=rss&mode=news&filter=16,17,18,19,20';
// http://channel9.msdn.com/Feeds/RSS/
require_code('rss');
$rss = new rss($url);
if (!is_null($rss->error)) {
return paragraph($rss->error, 'gfgrtyhyyfhd');
}
global $NEWS_CATS;
$NEWS_CATS = $GLOBALS['SITE_DB']->query_select('news_categories', array('*'), array('nc_owner' => NULL));
$NEWS_CATS = list_to_map('id', $NEWS_CATS);
$_postdetailss = array();
// Now for the actual stream contents
$max = array_key_exists('max_entries', $map) ? intval($map['max_entries']) : 10;
$content = new ocp_tempcode();
foreach ($rss->gleamed_items as $i => $item) {
if ($i >= $max) {
break;
}
if (array_key_exists('full_url', $item)) {
$full_url = $item['full_url'];
} elseif (array_key_exists('guid', $item)) {
$full_url = $item['guid'];
} elseif (array_key_exists('comment_url', $item)) {
$full_url = $item['comment_url'];
} else {
$full_url = '';
}
$_title = $item['title'];
$date = array_key_exists('clean_add_date', $item) ? get_timezoned_date($item['clean_add_date']) : array_key_exists('add_date', $item) ? $item['add_date'] : '';
$_postdetailss[] = array('DATE' => $date, 'FULL_URL' => $full_url, 'NEWS_TITLE' => $_title);
}
return do_template('BLOCK_BOTTOM_NEWS', array('_GUID' => '0fc123199c4d4b7af5a26706271b1f4f', 'POSTS' => $_postdetailss));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:41,代码来源:bottom_rss.php
示例4: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
require_lang('bulkupload');
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/bulkuploadassistant';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_adv_comcode';
$GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_BULK_UPLOAD');
$title = get_page_title('BULK_UPLOAD');
$parameter = post_param('parameter', '');
require_code('form_templates');
if ($parameter == '') {
$post_url = build_url(array('page' => '_SELF'), '_SELF');
$text = paragraph(do_lang_tempcode('BULK_UPLOAD_HELP'));
$submit_name = do_lang_tempcode('BULK_UPLOAD');
$fields = form_input_line(do_lang_tempcode('DIRECTORY'), do_lang_tempcode('DIRECTORY_BULK'), 'parameter', 'uploads/attachments/' . date('Y-m-d', utctime_to_usertime()), true);
return do_template('FORM_SCREEN', array('_GUID' => '77a2ca460745145d8a1d18cf24971fea', 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'FIELDS' => $fields, 'URL' => $post_url, 'TITLE' => $title, 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name));
} else {
breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('BULK_UPLOAD'))));
breadcrumb_set_self(do_lang_tempcode('_RESULTS'));
$out = $this->do_dir(get_custom_file_base() . '/' . filter_naughty($parameter, true));
if ($out->is_empty()) {
inform_exit(do_lang_tempcode('NO_FILES'));
}
return do_template('BULK_HELPER_RESULTS_SCREEN', array('_GUID' => '5d373553cf21a58f15006bd4e600a9ee', 'TITLE' => $title, 'RESULTS' => $out));
}
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:admin_bulkupload.php
示例5: get_future_version_information
/**
* Get information about new versions of ocPortal (or more accurately, what's wrong with this version).
*
* @return tempcode Information about the installed ocPortal version
*/
function get_future_version_information()
{
require_lang('version');
$url = 'http://ocportal.com/version.php?version=' . rawurlencode(ocp_version_full()) . '&lang=' . rawurlencode(user_lang());
$data = http_download_file($url, NULL, false);
if (!is_null($data)) {
$data = str_replace('"../upgrader.php"', '"' . get_base_url() . '/upgrader.php"', $data);
if ($GLOBALS['XSS_DETECT']) {
ocp_mark_as_escaped($data);
}
require_code('character_sets');
$data = convert_to_internal_encoding($data);
$table = new ocp_tempcode();
$lines = explode(chr(10), $data);
foreach ($lines as $line) {
if (trim($line) != '') {
$table->attach(paragraph($line));
}
}
$table = make_string_tempcode(preg_replace('#<p>\\s*</p>#', '', $table->evaluate()));
} else {
$table = paragraph(do_lang_tempcode('CANNOT_CONNECT_HOME'), 'dfsdff32ffd');
}
require_code('xhtml');
/*$table->attach('<script type="text/javascript">// <![CDATA[
window.open(\''.$url.'\');
//]]></script>');*/
return make_string_tempcode(xhtmlise_html($table->evaluate()));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:34,代码来源:version2.php
示例6: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
$forum = get_forum_type();
$out = new ocp_tempcode();
if ($forum != 'none') {
// Standard welcome back vs into greeting
$member = get_member();
if (is_guest($member)) {
$redirect = get_self_url(true, true);
$login_url = build_url(array('page' => 'login', 'type' => 'misc', 'redirect' => $redirect), get_module_zone('login'));
$join_url = $GLOBALS['FORUM_DRIVER']->join_url();
$join_bits = do_template('JOIN_OR_LOGIN', array('LOGIN_URL' => $login_url, 'JOIN_URL' => $join_url));
$p = do_lang_tempcode('WELCOME', $join_bits);
$out->attach(paragraph($p, 'hhrt4dsgdsgd'));
} else {
$out->attach(paragraph(do_lang_tempcode('WELCOME_BACK', escape_html($GLOBALS['FORUM_DRIVER']->get_username($member))), 'gfgdf9gjd'));
}
}
$message = get_option('welcome_message');
if (has_actual_page_access(get_member(), 'admin_config')) {
if ($message != '') {
$message .= ' [[page="_SEARCH:admin_config:category:SITE#group_GENERAL"]' . do_lang('EDIT') . '[/page]]';
}
}
$out->attach(comcode_to_tempcode($message, NULL, true));
return $out;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:34,代码来源:main_greeting.php
示例7: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_code('type_validation');
require_lang('phpdoc');
require_code('php');
require_css('adminzone');
disable_php_memory_limit();
$filename = (array_key_exists('param', $map) ? $map['param'] : 'sources/global2') . '.php';
if (substr($filename, -8) == '.php.php') {
$filename = substr($filename, 0, strlen($filename) - 4);
}
$full_path = (get_file_base() != '' ? get_file_base() . '/' : '') . filter_naughty($filename);
if (!file_exists($full_path)) {
return paragraph(do_lang_tempcode('MISSING_RESOURCE'));
}
$_classes = get_php_file_api($filename);
$classes = new ocp_tempcode();
foreach ($_classes as $class) {
if ($class['name'] == '__global') {
$class['name'] = do_lang('GLOBAL_FUNCTIONS') . '_' . basename($filename);
}
$function_summaries = new ocp_tempcode();
$functions = new ocp_tempcode();
foreach ($class['functions'] as $function) {
$ret = render_php_function($function, $class);
$functions->attach($ret[0]);
$function_summaries->attach($ret[1]);
}
$classes->attach(do_template('PHP_CLASS', array('_GUID' => '5d58fc42c5fd3a5dd190f3f3699610c2', 'CLASS_NAME' => $class['name'], 'FUNCTION_SUMMARIES' => $function_summaries, 'FUNCTIONS' => $functions)));
}
return do_template('PHP_FILE', array('_GUID' => '6f422e6a6e846d49864d7325b212109f', 'FILENAME' => $filename, 'CLASSES' => $classes));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:main_code_documentor.php
示例8: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
require_lang('custom_comcode');
$tags = array();
$wmap = array('tag_enabled' => 1);
if (!has_specific_permission(get_member(), 'comcode_dangerous')) {
$wmap['tag_dangerous_tag'] = 0;
}
$tags = array_merge($tags, $GLOBALS['SITE_DB']->query_select('custom_comcode', array('tag_title', 'tag_description', 'tag_example', 'tag_parameters', 'tag_replace', 'tag_tag', 'tag_dangerous_tag', 'tag_block_tag', 'tag_textual_tag'), $wmap));
if (isset($GLOBALS['FORUM_DB']) && $GLOBALS['FORUM_DB']->connection_write != $GLOBALS['SITE_DB']->connection_write && get_forum_type() == 'ocf') {
$tags = array_merge($tags, $GLOBALS['FORUM_DB']->query_select('custom_comcode', array('tag_title', 'tag_description', 'tag_example', 'tag_parameters', 'tag_replace', 'tag_tag', 'tag_dangerous_tag', 'tag_block_tag', 'tag_textual_tag'), $wmap));
}
// From Comcode hooks
$hooks = find_all_hooks('systems', 'comcode');
foreach (array_keys($hooks) as $hook) {
require_code('hooks/systems/comcode/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_comcode_' . filter_naughty_harsh($hook), true);
$tags[] = $object->get_tag();
}
if (!array_key_exists(0, $tags)) {
return paragraph(do_lang_tempcode('NONE_EM'), '', 'nothing_here');
}
$content = new ocp_tempcode();
foreach ($tags as $tag) {
$content->attach(do_template('CUSTOM_COMCODE_TAG_ROW', array('_GUID' => '28c257f5d0c596aa828fd9556b0df4a9', 'TITLE' => is_string($tag['tag_title']) ? $tag['tag_title'] : get_translated_text($tag['tag_title']), 'DESCRIPTION' => is_string($tag['tag_description']) ? $tag['tag_description'] : get_translated_text($tag['tag_description']), 'EXAMPLE' => $tag['tag_example'])));
}
return do_template('BLOCK_MAIN_CUSTOM_COMCODE_TAGS', array('_GUID' => 'b8d3436e6e5fe679ae9b0a368e607610', 'TAGS' => $content));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:main_custom_comcode_tags.php
示例9: render_tab
/**
* Standard modular render function for profile tab hooks.
*
* @param MEMBER The ID of the member who is being viewed
* @param MEMBER The ID of the member who is doing the viewing
* @param boolean Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later
* @return array A triple: The tab title, the tab contents, the suggested tab order
*/
function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
{
$title = do_lang_tempcode('MODULE_TRANS_NAME_warnings');
$order = 80;
if ($leave_to_ajax_if_possible) {
return array($title, NULL, $order);
}
require_lang('ocf');
require_css('ocf');
$warnings = new ocp_tempcode();
$rows = $GLOBALS['FORUM_DB']->query_select('f_warnings', array('*'), array('w_member_id' => $member_id_of, 'w_is_warning' => 1));
foreach ($rows as $row) {
$warning_by = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['w_by']);
$date = get_timezoned_date($row['w_time']);
if ($row['w_explanation'] == '') {
$row['w_explanation'] = '?';
} else {
$row['w_explanation'] = str_replace(chr(10), ' ', $row['w_explanation']);
}
$row['w_explanation_orig'] = $row['w_explanation'];
if (strlen($row['w_explanation']) > 30) {
$row['w_explanation'] = substr($row['w_explanation'], 0, 27) . '...';
}
$explanation = hyperlink(build_url(array('page' => 'warnings', 'type' => '_ed', 'id' => $row['id'], 'redirect' => get_self_url(true)), get_module_zone('warnings')), $row['w_explanation'], false, true, $row['w_explanation_orig']);
$warnings->attach(paragraph(do_lang_tempcode('MEMBER_WARNING', $explanation, $warning_by, array(make_string_tempcode(escape_html($date)))), 'treyerhy34y'));
}
$content = do_template('OCF_MEMBER_PROFILE_WARNINGS', array('MEMBER_ID' => strval($member_id_of), 'WARNINGS' => $warnings));
return array($title, $content, $order);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:37,代码来源:warnings.php
示例10: entry
function entry()
{
$paragraphs = "";
$i = 0;
while ($i <= 4) {
$paragraphs .= "<p>" . paragraph() . "</p>";
$i++;
}
return $paragraphs;
}
开发者ID:jhsu,项目名称:DMS315,代码行数:10,代码来源:index.php
示例11: render_field_value
/**
* Convert a field value to something renderable.
*
* @param array The field details
* @param mixed The raw value
* @return mixed Rendered field (tempcode or string)
*/
function render_field_value($field, $ev)
{
if (is_object($ev)) {
return $ev;
}
$ret = new ocp_tempcode();
foreach (explode(chr(10), $ev) as $ev) {
$ret->attach(paragraph(escape_html($ev)));
}
return $ret;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:18,代码来源:short_text_multi.php
示例12: get_catalogue_category_html
/**
* Get tempcode for a catalogue category 'feature box' for the given row
*
* @param array The database field row of it
* @param ID_TEXT The zone to use
* @param boolean Whether to put it in a box
* @return tempcode A box for it, linking to the full page
*/
function get_catalogue_category_html($row, $zone = '_SEARCH', $put_in_box = true)
{
$content = paragraph(get_translated_tempcode($row['cc_description']), 'yghjgfjftgerr');
$url = build_url(array('page' => 'catalogues', 'type' => 'category', 'id' => $row['id']), $zone);
$tree = catalogue_category_breadcrumbs($row['id']);
if (!$tree->is_empty()) {
$content->attach(paragraph(do_lang_tempcode('LOCATED_IN', $tree)));
}
$preview = do_template('SIMPLE_PREVIEW_BOX', array('SUMMARY' => $content, 'URL' => $url));
if (!$put_in_box) {
return $preview;
}
return put_in_standard_box($preview, get_translated_text($row['cc_title']));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:22,代码来源:catalogues.php
示例13: action_done
/**
* Standard actualisation stage of pointstore item purchase.
*
* @return tempcode The UI
*/
function action_done()
{
$class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));
$title = get_page_title('OCGIFTS_TITLE');
require_code('form_templates');
$fields = new ocp_tempcode();
$fields->attach(form_input_username(do_lang_tempcode('TO_USERNAME'), do_lang_tempcode('MEMBER_TO_GIVE'), 'username', get_param('username', ''), true));
$fields->attach(form_input_text(do_lang_tempcode('GIFT_MESSAGE'), do_lang_tempcode('DESCRIPTION_GIFT_MESSAGE'), 'gift_message', '', true));
$fields->attach(form_input_tick(do_lang_tempcode('ANONYMOUS'), do_lang_tempcode('DESCRIPTION_ANONYMOUS'), 'anonymous', false));
$submit_name = do_lang_tempcode('SEND_GIFT');
$text = paragraph(do_lang_tempcode('CHOOSE_MEMBER'));
$post_url = build_url(array('page' => 'pointstore', 'type' => 'action_done2', 'id' => 'ocgifts', 'gift' => get_param('gift', 0)), '_SEARCH');
return do_template('FORM_SCREEN', array('SKIP_VALIDATION' => true, 'STAFF_HELP_URL' => '', 'HIDDEN' => '', 'TITLE' => $title, 'FIELDS' => $fields, 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name, 'URL' => $post_url));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:ocgifts.php
示例14: render_field_value
/**
* Convert a field value to something renderable.
*
* @param array The field details
* @param mixed The raw value
* @return mixed Rendered field (tempcode or string)
*/
function render_field_value($field, $ev)
{
if (is_object($ev)) {
return $ev;
}
if ($ev == '') {
return new ocp_tempcode();
}
$out = new ocp_tempcode();
foreach (explode(chr(10), $ev) as $ev) {
$out->attach(paragraph($GLOBALS['FORUM_DRIVER']->member_profile_hyperlink(intval($ev))));
}
return $out;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:21,代码来源:user_multi.php
示例15: _text
/**
* Standard stage of pointstore item purchase.
*
* @return tempcode The UI
*/
function _text()
{
if (get_option('is_on_flagrant_buy') == '0') {
return new ocp_tempcode();
}
$title = get_page_title('TITLE_NEWTEXT');
// Build up fields
require_code('form_templates');
$fields = form_input_line_comcode(do_lang_tempcode('MESSAGE'), do_lang_tempcode('MESSAGE_DESCRIPTION'), 'message', '', true);
$fields->attach(form_input_integer(do_lang_tempcode('NUMBER_DAYS'), do_lang_tempcode('NUMBER_DAYS_DESCRIPTION'), 'days', 1, true));
$price = intval(get_option('text'));
$text = paragraph(do_lang_tempcode('FLAGRANT_GUIDE', integer_format($price)));
// Return template
$post_url = build_url(array('page' => '_SELF', 'type' => '__text', 'id' => 'flagrant'), '_SELF');
return do_template('FORM_SCREEN', array('_GUID' => '3584ba6a16c9a51829dc3b25b58067f6', 'HIDDEN' => '', 'TITLE' => $title, 'ACTION' => do_lang_tempcode('TITLE_NEWTEXT'), 'TEXT' => $text, 'URL' => $post_url, 'SUBMIT_NAME' => do_lang_tempcode('PURCHASE'), 'FIELDS' => $fields));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:21,代码来源:flagrant.php
示例16: authors_script
/**
* Shows an HTML page of all authors clickably.
*/
function authors_script()
{
require_lang('authors');
global $NON_CANONICAL_PARAMS;
$NON_CANONICAL_PARAMS[] = 'max';
$start = get_param_integer('start', 0);
$max = get_param_integer('max', 300);
$author_fields = $GLOBALS['SITE_DB']->query('SELECT m_name,m_table FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'db_meta WHERE m_name LIKE \'' . db_encode_like('%author') . '\'');
$rows = array();
foreach ($author_fields as $field) {
if ($field['m_table'] != 'addons' && $field['m_table'] != 'blocks' && $field['m_table'] != 'modules') {
$rows_new = $GLOBALS['SITE_DB']->query('SELECT DISTINCT ' . $field['m_name'] . ' AS author FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . $field['m_table'] . ' WHERE ' . db_string_not_equal_to($field['m_name'], '') . ' ORDER BY ' . $field['m_name'], $max + $start);
foreach ($rows_new as $a) {
if (!array_key_exists($a['author'], $rows) || $field['m_table'] == 'authors') {
$rows[$a['author']] = $field['m_table'];
}
}
}
}
$rows = array_unique($rows);
$field_name = get_param('field_name');
$content = new ocp_tempcode();
$i = 0;
foreach ($rows as $author => $table) {
if ($i >= $start && $i < $start + $max) {
if ($table == 'authors') {
$content->attach(do_template('AUTHOR_POPUP_WINDOW_DEFINED', array('_GUID' => 'cffa9926cebd3ec2920677266a3299ea', 'FIELD_NAME' => $field_name, 'AUTHOR' => $author)));
} else {
$content->attach(do_template('AUTHOR_POPUP_WINDOW_UNDEFINED', array('_GUID' => '6210be6d1eef4bc2bda7f49947301f97', 'FIELD_NAME' => $field_name, 'AUTHOR' => $author)));
}
}
$i++;
}
if ($content->is_empty()) {
$content = paragraph(do_lang_tempcode('NO_ENTRIES'), 'dfids09fi;lk;3');
}
if ($i >= $start + $max) {
$keep = symbol_tempcode('KEEP');
$next_link = find_script('authors') . '?field_name=' . urlencode($field_name) . '&start=' . strval($start + $max) . '&max=' . strval($max) . $keep->evaluate();
} else {
$next_link = NULL;
}
$echo = do_template('STYLED_HTML_WRAP', array('_GUID' => 'ab8d8c9d276530d82ddd84202aacf32f', 'TITLE' => do_lang_tempcode('CHOOSE_AUTHOR'), 'NEXT_LINK' => $next_link, 'CONTENT' => $content));
$echo->evaluate_echo();
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:48,代码来源:authors.php
示例17: get_cedi_page_html
/**
* Get tempcode for a CEDI post 'feature box' for the given row
*
* @param array The database field row of it
* @param ID_TEXT The zone to use
* @param boolean Whether to put it in a box
* @return tempcode A box for it, linking to the full page
*/
function get_cedi_page_html($row, $zone = '_SEARCH', $put_in_box = true)
{
$content = paragraph(get_translated_tempcode($row['description']), 'tyrtfjhggfdf');
$url = build_url(array('page' => 'cedi', 'type' => 'misc', 'id' => $row['id'] == db_get_first_id() ? NULL : $row['id']), $zone);
if ($put_in_box) {
$chain = cedi_derive_chain($row['id']);
$chain = preg_replace('#/[^/]+#', '', $chain);
if ($chain != '') {
$tree = cedi_breadcrumbs($chain, NULL, true);
if (!$tree->is_empty()) {
$content->attach(paragraph(do_lang_tempcode('LOCATED_IN', $tree)));
}
}
}
$preview = do_template('SIMPLE_PREVIEW_BOX', array('SUMMARY' => $content, 'URL' => $url));
if (!$put_in_box) {
return $preview;
}
return put_in_standard_box($preview, do_lang_tempcode('CEDI_PAGE', escape_html(get_translated_text($row['title']))));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:28,代码来源:cedi.php
示例18: render_tab
/**
* Standard modular render function for profile tabs edit hooks.
*
* @param MEMBER The ID of the member who is being viewed
* @param MEMBER The ID of the member who is doing the viewing
* @param boolean Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later
* @return ?array A tuple: The tab title, the tab body text (may be blank), the tab fields, extra Javascript (may be blank) the suggested tab order, hidden fields (optional) (NULL: if $leave_to_ajax_if_possible was set)
*/
function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
{
$title = do_lang_tempcode('PHOTO');
$order = 30;
// Actualiser
if (post_param_integer('submitting_photo_tab', 0) == 1) {
require_code('ocf_members_action');
require_code('ocf_members_action2');
ocf_member_choose_photo('photo_url', 'photo_file', $member_id_of);
attach_message(do_lang_tempcode('SUCCESS_SAVE'), 'inform');
}
if ($leave_to_ajax_if_possible) {
return NULL;
}
$photo_url = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_photo_url');
$thumb_url = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_photo_thumb_url');
// UI fields
$fields = new ocp_tempcode();
require_code('form_templates');
$fields->attach(form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('DESCRIPTION_UPLOAD'), 'photo_file', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images'))));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('URL')), do_lang_tempcode('DESCRIPTION_ALTERNATE_URL'), 'photo_url', $photo_url, false));
if (get_option('is_on_gd') == '0' || !function_exists('imagetypes')) {
$thumb_width = get_option('thumb_width');
$fields->attach(form_input_upload(do_lang_tempcode('THUMBNAIL'), do_lang_tempcode('DESCRIPTION_THUMBNAIL', escape_html($thumb_width)), 'photo_file2', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images'))));
$fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('URL')), do_lang_tempcode('DESCRIPTION_ALTERNATE_URL'), 'photo_thumb_url', $thumb_url, false));
}
$hidden = new ocp_tempcode();
handle_max_file_size($hidden, 'image');
$hidden->attach(form_input_hidden('submitting_photo_tab', '1'));
$text = new ocp_tempcode();
require_code('images');
$max = floatval(get_max_image_size()) / floatval(1024 * 1024);
if ($max < 3.0) {
require_code('files2');
$config_url = get_upload_limit_config_url();
$text->attach(paragraph(do_lang_tempcode(is_null($config_url) ? 'MAXIMUM_UPLOAD' : 'MAXIMUM_UPLOAD_STAFF', escape_html($max > 10.0 ? integer_format(intval($max)) : float_format($max)), is_null($config_url) ? '' : escape_html($config_url))));
}
$text = do_template('OCF_EDIT_PHOTO_TAB', array('TEXT' => $text, 'MEMBER_ID' => strval($member_id_of), 'USERNAME' => $GLOBALS['FORUM_DRIVER']->get_username($member_id_of), 'PHOTO' => $GLOBALS['FORUM_DRIVER']->get_member_photo_url($member_id_of)));
$javascript = '';
return array($title, $fields, $text, $javascript, $order, $hidden);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:49,代码来源:photo.php
示例19: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_lang('newsletter');
require_lang('javascript');
$newsletter_id = array_key_exists('param', $map) ? intval($map['param']) : db_get_first_id();
$_newsletter_title = $GLOBALS['SITE_DB']->query_value_null_ok('newsletters', 'title', array('id' => $newsletter_id));
if (is_null($_newsletter_title)) {
return paragraph(do_lang_tempcode('MISSING_RESOURCE'));
}
$newsletter_title = get_translated_text($_newsletter_title);
$address = post_param('address' . strval($newsletter_id), '');
if ($address != '') {
require_code('newsletter');
require_code('type_validation');
if (!is_valid_email_address($address)) {
$msg = do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('INVALID_EMAIL_ADDRESS')));
return do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP', array('URL' => get_self_url(), 'MSG' => $msg));
}
if (!array_key_exists('path', $map)) {
$map['path'] = 'uploads/website_specific/signup.txt';
}
require_code('character_sets');
$password = basic_newsletter_join($address, 4, NULL, !file_exists(get_custom_file_base() . '/' . $map['path']), $newsletter_id, post_param('firstname' . strval($newsletter_id), ''), post_param('lastname' . strval($newsletter_id), ''));
if ($password == '') {
return do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('NEWSLETTER_THIS_ALSO')));
}
if ($password == do_lang('NA')) {
$manage_url = build_url(array('page' => 'newsletter', 'email' => $address), get_module_zone('newsletter'));
return do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('ALREADY_EMAIL_ADDRESS', escape_html($manage_url->evaluate()))));
}
require_code('mail');
if (file_exists(get_custom_file_base() . '/' . $map['path'])) {
$url = (url_is_local($map['path']) ? get_custom_base_url() . '/' : '') . $map['path'];
mail_wrap(array_key_exists('subject', $map) ? $map['subject'] : do_lang('WELCOME'), convert_to_internal_encoding(http_download_file($url)), array($address), array_key_exists('to', $map) ? $map['to'] : '', '', '', 3, NULL, false, NULL, true);
}
return do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP_DONE', array('_GUID' => '9953c83685df4970de8f23fcd5dd15bb', 'NEWSLETTER_TITLE' => $newsletter_title, 'NID' => strval($newsletter_id), 'PASSWORD' => $password));
} else {
return do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP', array('NEWSLETTER_TITLE' => $newsletter_title, 'NID' => strval($newsletter_id), 'URL' => get_self_url()));
}
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:46,代码来源:main_newsletter_signup.php
示例20: decline
/**
* The actualiser to decline a members joining of a usergroup.
*
* @return tempcode The UI
*/
function decline()
{
$title = get_page_title('DECLINE_FROM_GROUP');
$id = post_param_integer('id', NULL);
if (is_null($id)) {
$id = get_param_integer('id');
require_code('form_templates');
$text = paragraph(do_lang_tempcode('OPTIONAL_REASON'));
$submit_name = do_lang_tempcode('DECLINE_FROM_GROUP');
$post_url = build_url(array('page' => '_SELF', 'type' => get_param('type')), '_SELF', NULL, true);
$fields = new ocp_tempcode();
$hidden = form_input_hidden('id', strval($id));
$fields->attach(form_input_line(do_lang_tempcode('REASON'), '', 'reason', '', false));
return do_template('FORM_SCREEN', array('SKIP_VALIDATION' => true, 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
}
if (!ocf_may_control_group($id, get_member())) {
access_denied('I_ERROR');
}
$member_id = get_param_integer('member_id');
ocf_member_validate_into_group($id, $member_id, true, post_param('reason'));
$url = build_url(array('page' => '_SELF', 'type' => 'view', 'id' => $id), '_SELF');
return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:28,代码来源:groups.php
注:本文中的paragraph函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论