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


PHP fetch_word_wrapped_string函数代码示例

本文整理汇总了PHP中fetch_word_wrapped_string函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_word_wrapped_string函数的具体用法?PHP fetch_word_wrapped_string怎么用?PHP fetch_word_wrapped_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: verify_title

 /**
  * Verifies the title is valid and sets up the title for saving (wordwrap, censor, etc).
  *
  * @param	string	Title text
  *
  * @param	bool	Whether the title is valid
  */
 function verify_title(&$title)
 {
     // replace html-encoded spaces with actual spaces
     $title = preg_replace('/&#(0*32|x0*20);/', ' ', $title);
     $title = trim($title);
     if ($this->registry->options['titlemaxchars'] and $title != $this->existing['title']) {
         if (!empty($this->info['show_title_error'])) {
             if (($titlelen = vbstrlen($title)) > $this->registry->options['titlemaxchars']) {
                 // title too long
                 $this->error('title_toolong', $titlelen, $this->registry->options['titlemaxchars']);
                 return false;
             }
         } else {
             if (empty($this->info['is_automated'])) {
                 // not showing the title length error, just chop it
                 $title = vbchop($title, $this->registry->options['titlemaxchars']);
             }
         }
     }
     require_once DIR . '/includes/functions_newpost.php';
     // censor, remove all caps subjects, and htmlspecialchars title
     $title = fetch_no_shouting_text(fetch_censored_text($title));
     // do word wrapping
     $title = fetch_word_wrapped_string($title);
     return true;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:33,代码来源:class_dm_visitormessage.php

示例2: fetch_pictureinfo

/**
* Fetches picture info for the specified picture/album combination. That is,
* the picture must be in the specified album. Also does some preperation on
* the data for display.
*
* @param	integer	ID of picture
* @param	integer	ID of album
*
* @return	array	Array of picture information
*/
function fetch_pictureinfo($attachmentid, $albumid)
{
	global $vbulletin;

	$pictureinfo = $vbulletin->db->query_first("
		SELECT
			a.attachmentid, a.userid, a.caption, a.reportthreadid, a.state, a.dateline, a.contentid AS albumid,
			fd.filedataid, fd.filesize, fd.width, fd.height, fd.thumbnail_filesize, IF(fd.thumbnail_filesize > 0, 1, 0) AS hasthumbnail
		FROM " . TABLE_PREFIX . "attachment AS a
		INNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid)
		INNER JOIN " . TABLE_PREFIX . "album AS album ON (a.contentid = album.albumid)
		WHERE
			a.attachmentid = " . intval($attachmentid) . "
				AND
			album.albumid = " . intval($albumid) . "
	");

	if (!$pictureinfo)
	{
		return array();
	}

	$pictureinfo['caption_html'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($pictureinfo['caption'])));

	($hook = vBulletinHook::fetch_hook('album_fetch_pictureinfo')) ? eval($hook) : false;

	return $pictureinfo;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:38,代码来源:functions_album.php

示例3: fetch_event_date_time

function fetch_event_date_time($info)
{
    global $timerange, $vbulletin, $vbphrase, $months, $days, $day, $month, $year, $holiday, $eventdate;
    global $titlecolor, $date1, $date2, $time1, $time2, $recurcriteria, $allday, $show;
    require_once DIR . '/includes/functions_misc.php';
    $daterange = '';
    $recurcriteria = '';
    $show['recuroption'] = false;
    $titlecolor = 'alt1';
    $info['title'] = htmlspecialchars_uni($info['title']);
    if ($wordwrap != 0) {
        $info['title'] = fetch_word_wrapped_string($info['title']);
    }
    $info['event'] = iif(empty($info['event']), '&nbsp', parse_calendar_bbcode($info['event'], $info['allowsmilies']));
    if (!$info['recurring'] and !$info['singleday']) {
        $daystamp = gmmktime(0, 0, 0, $month, $day, $year);
        $eventfirstday = gmmktime(0, 0, 0, gmdate('n', $info['dateline_from_user']), gmdate('j', $info['dateline_from_user']), gmdate('Y', $info['dateline_from_user']));
        $eventlastday = gmmktime(0, 0, 0, gmdate('n', $info['dateline_to_user']), gmdate('j', $info['dateline_to_user']), gmdate('Y', $info['dateline_to_user']));
        if ($info['dateline_from'] == $daystamp) {
            if ($eventfirstday == $daystamp) {
                if ($eventfirstday != $eventlastday) {
                    if (vbdate('g:ia', $info['dateline_from_user'], false, false) == '12:00am') {
                        $allday = true;
                    } else {
                        $time2 = vbgmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
                    }
                }
            }
        } else {
            if ($eventlastday == $daystamp) {
                $time1 = gmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
                $time1 = vbgmdate($vbulletin->options['timeformat'], gmmktime(0, 0, 0, $month, $day, $year));
            } else {
                $allday = true;
                // Used in conditional
            }
        }
    }
    if ($info['holidayid']) {
        $eventdate = vbgmdate($vbulletin->options['dateformat'], gmmktime(0, 0, 0, $month, $day, $year));
    } else {
        if ($info['singleday']) {
            $eventdate = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from']);
        } else {
            $date1 = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from_user']);
            $date2 = vbgmdate($vbulletin->options['dateformat'], $info['dateline_to_user']);
            $time1 = vbgmdate($vbulletin->options['timeformat'], $info['dateline_from_user']);
            $time2 = vbgmdate($vbulletin->options['timeformat'], $info['dateline_to_user']);
            if ($info['recurring']) {
                $recurcriteria = fetch_event_criteria($info);
                $show['recuroption'] = true;
            } else {
                $show['daterange'] = iif($date1 != $date2, true, false);
                $eventdate = vbgmdate($vbulletin->options['dateformat'], $info['dateline_from_user']);
            }
        }
    }
    return $info;
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:59,代码来源:functions_calendar.php

示例4: fetch_pictureinfo

/**
* Fetches picture info for the specified picture/album combination. That is,
* the picture must be in the specified album. Also does some preperation on
* the data for display.
*
* @param	integer	ID of picture
* @param	integer	ID of album
*
* @return	array	Array of picture information
*/
function fetch_pictureinfo($attachmentid, $albumid)
{
    global $vbulletin;
    $pictureinfo = $vbulletin->db->query_first("\n\t\tSELECT\n\t\t\ta.attachmentid, a.userid, a.caption, a.reportthreadid, a.state, a.dateline, a.contentid AS albumid,\n\t\t\tfd.filedataid, fd.filesize, fd.width, fd.height, fd.thumbnail_filesize, IF(fd.thumbnail_filesize > 0, 1, 0) AS hasthumbnail\n\t\tFROM " . TABLE_PREFIX . "attachment AS a\n\t\tINNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid)\n\t\tINNER JOIN " . TABLE_PREFIX . "album AS album ON (a.contentid = album.albumid)\n\t\tWHERE\n\t\t\ta.attachmentid = " . intval($attachmentid) . "\n\t\t\t\tAND\n\t\t\talbum.albumid = " . intval($albumid) . "\n\t");
    if (!$pictureinfo) {
        return array();
    }
    $pictureinfo['caption_html'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($pictureinfo['caption'])));
    return $pictureinfo;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:20,代码来源:functions_album.php

示例5: fetch_pictureinfo

/**
* Fetches picture info for the specified picture/album combination. That is,
* the picture must be in the specified album. Also does some preperation on
* the data for display.
*
* @param	integer	ID of picture
* @param	integer	ID of album
*
* @return	array	Array of picture information
*/
function fetch_pictureinfo($pictureid, $albumid)
{
    global $vbulletin;
    $pictureinfo = $vbulletin->db->query_first("\n\t\tSELECT picture.pictureid, picture.userid, picture.caption, picture.extension, picture.filesize,\n\t\t\tpicture.width, picture.height, picture.reportthreadid, picture.state,\n\t\t\tpicture.idhash, picture.thumbnail_filesize, albumpicture.dateline, albumpicture.albumid\n\t\tFROM " . TABLE_PREFIX . "albumpicture AS albumpicture\n\t\tINNER JOIN " . TABLE_PREFIX . "picture AS picture ON (picture.pictureid = albumpicture.pictureid)\n\t\tWHERE albumpicture.albumid = " . intval($albumid) . "\n\t\t\tAND albumpicture.pictureid = " . intval($pictureid));
    if (!$pictureinfo) {
        return array();
    }
    $pictureinfo['caption_html'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($pictureinfo['caption'])));
    ($hook = vBulletinHook::fetch_hook('album_fetch_pictureinfo')) ? eval($hook) : false;
    return $pictureinfo;
}
开发者ID:holandacz,项目名称:nb4,代码行数:21,代码来源:functions_album.php

示例6: fetch_entry_tagbits

/**
* Fetches the tagbits for display in an entry
*
* @param	array	Blog info
*
* @return	string	Tag bits
*/
function fetch_entry_tagbits($bloginfo, &$userinfo)
{
	global $vbulletin, $vbphrase, $show, $template_hook;

	if ($bloginfo['taglist'])
	{
		$tag_array = explode(',', $bloginfo['taglist']);

		$tag_list = array();
		foreach ($tag_array AS $tag)
		{
			$tag = trim($tag);
			if ($tag === '')
			{
				continue;
			}
			$tag_url = urlencode(unhtmlspecialchars($tag));
			$tag = fetch_word_wrapped_string($tag);

			($hook = vBulletinHook::fetch_hook('blog_tag_fetchbit')) ? eval($hook) : false;

			$templater = vB_Template::create('blog_tagbit');
				$templater->register('tag', $tag);
				$templater->register('tag_url', $tag_url);
				$templater->register('userinfo', $userinfo);
				$templater->register('pageinfo', array('tag' => $tag_url));
			$tag_list[] = trim($templater->render());
		}
	}
	else
	{
		$tag_list = array();
	}

	($hook = vBulletinHook::fetch_hook('blog_tag_fetchbit_complete')) ? eval($hook) : false;

	return implode(", ", $tag_list);
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:45,代码来源:blog_functions_tag.php

示例7: print_archive_page_navigation

    if ($p == 0) {
        $p = 1;
    }
    $output .= print_archive_page_navigation($threadinfo['replycount'] + 1, $vbulletin->options['archive_postsperpage'], "t-{$threadinfo['threadid']}");
    $posts = $db->query_read_slave("\n\t\tSELECT post.postid, post.pagetext, IFNULL( user.username , post.username ) AS username, dateline\n\t\tFROM " . TABLE_PREFIX . "post AS post\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = post.userid)\n\t\tWHERE threadid = {$threadinfo['threadid']}\n\t\t\tAND visible = 1\n\t\t\t{$globalignore}\n\t\tORDER BY dateline ASC\n\t\tLIMIT " . ($p - 1) * $vbulletin->options['archive_postsperpage'] . ',' . $vbulletin->options[archive_postsperpage]);
    if ($pda and false) {
        $output .= "<span id=\"posting\"><a href=\"?message=1\" rel=\"nofollow\">New Reply</a></span>";
    }
    $i = 0;
    while ($post = $db->fetch_array($posts)) {
        $i++;
        $post['pagetext_simp'] = strip_bbcode($post['pagetext']);
        $post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline']);
        $post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);
        if ($vbulletin->options['wordwrap'] != 0) {
            $post['pagetext_simp'] = fetch_word_wrapped_string($post['pagetext_simp']);
        }
        $post['pagetext_simp'] = fetch_censored_text($post['pagetext_simp']);
        ($hook = vBulletinHook::fetch_hook('archive_thread_post')) ? eval($hook) : false;
        $output .= "\n<div class=\"post\"><div class=\"posttop\"><div class=\"username\">{$post['username']}</div><div class=\"date\">{$post['postdate']}, {$post['posttime']}</div></div>";
        $output .= "<div class=\"posttext\">" . nl2br(htmlspecialchars_uni($post['pagetext_simp'])) . "</div></div><hr />\n\n";
    }
}
// ********************************************************************************************
// display login
if ($do == 'login') {
    $output .= print_archive_navigation(array());
    $output .= "<p class=\"largefont\">{$vbphrase['view_full_version']}: <a href=\"" . $vbulletin->options['bburl'] . '/' . $vbulletin->options['forumhome'] . '.php">' . $vbulletin->options['bbtitle'] . "</a></p>\n";
    if (SLASH_METHOD) {
        $loginlink = 'index.php' . (!empty($querystring) ? "/{$querystring}" : '') . '?login=1';
    } else {
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:index.php

示例8: prep_post_start

	/**
	* Processes miscellaneous post items at the beginning of the construction process.
	*/
	function prep_post_start()
	{
		$this->post = array_merge($this->post, convert_bits_to_array($this->post['options'], $this->registry->bf_misc_useroptions));
		$this->post = array_merge($this->post, convert_bits_to_array($this->post['adminoptions'], $this->registry->bf_misc_adminoptions));

		// do word wrap
		if ($this->registry->options['wordwrap'])
		{
			$this->post['title'] = fetch_word_wrapped_string($this->post['title']);
		}
		$this->post['title'] = fetch_censored_text($this->post['title']);

		// init imod checkbox value
		$this->post['checkbox_value'] = 0;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:18,代码来源:class_postbit.php

示例9: vB_Text_Diff

    if ($compare['oldver'] and $compare['newver']) {
        // make the diff
        require_once DIR . '/includes/class_diff.php';
        $textdiff_obj = new vB_Text_Diff($compare['oldver']['pagetext'], $compare['newver']['pagetext']);
        $diff = $textdiff_obj->fetch_diff();
        ($hook = vBulletinHook::fetch_hook('posthistory_compare')) ? eval($hook) : false;
        foreach ($diff as $diffrow) {
            $compare_show = array();
            if ($diffrow->old_class == 'unchanged' and $diffrow->new_class == 'unchanged') {
                // no change
                $compare_show['olddata'] = fetch_word_wrapped_string(nl2br(htmlspecialchars_uni(implode("\n", $diffrow->fetch_data_old()))));
                $compare_show['template'] = 'posthistory_content_not_changed';
            } else {
                // something has changed
                $compare_show['olddata'] = fetch_word_wrapped_string(nl2br(htmlspecialchars_uni(implode("\n", $diffrow->fetch_data_old()))));
                $compare_show['newdata'] = fetch_word_wrapped_string(nl2br(htmlspecialchars_uni(implode("\n", $diffrow->fetch_data_new()))));
                $compare_show['template'] = 'posthistory_content_changed';
            }
            ($hook = vBulletinHook::fetch_hook('posthistory_comparebit')) ? eval($hook) : false;
            eval('$comparebits .= "' . fetch_template($compare_show['template']) . '";');
        }
        $show['titlecompare'] = $compare['oldver']['title'] != $compare['newver']['title'];
        $oldtitle = $compare['oldver']['title'] !== '' ? $compare['oldver']['title'] : '&nbsp;';
        $newtitle = $compare['newver']['title'] !== '' ? $compare['newver']['title'] : '&nbsp;';
        $form_do = 'list';
        $button_text = $vbphrase['go_back'];
    }
}
// #############################################################################
// draw navbar
$navbits = array();
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:posthistory.php

示例10: process_thread_array

function process_thread_array($thread, $lastread = -1, $allowicons = -1)
{
    global $vbphrase, $stylevar, $foruminfo, $vbulletin;
    global $newthreads, $dotthreads, $perpage, $ignore, $show;
    static $pperpage;
    if ($pperpage == 0) {
        // lets calculate posts per page
        // the following code should be left just in case we plan to use this function in showthread at some point
        if (THIS_SCRIPT != 'showthread') {
            $pperpage = sanitize_maxposts();
        } else {
            $pperpage = sanitize_maxposts($perpage);
        }
    }
    // init value for the inline moderation checkbox
    $thread['checkbox_value'] = 0;
    if (can_moderate($thread['forumid'], 'caneditthreads') or $thread['open'] and $thread['postuserid'] == $vbulletin->userinfo['userid'] and $forumperms = fetch_permissions($thread['forumid']) and $forumperms & $vbulletin->bf_ugp_forumpermissions['caneditpost'] and $thread['dateline'] + $vbulletin->options['editthreadtitlelimit'] * 60 > TIMENOW) {
        $thread['title_editable'] = '<a rel="vB::AJAX"></a>';
        $show['ajax_js'] = true;
    } else {
        $thread['title_editable'] = '';
    }
    if ($thread['open'] != 10 and (can_moderate($thread['forumid'], 'canopenclose') or $thread['postuserid'] == $vbulletin->userinfo['userid'] and $forumperms = fetch_permissions($thread['forumid']) and $forumperms & $vbulletin->bf_ugp_forumpermissions['canopenclose'])) {
        $thread['openclose_editable'] = '<a rel="vB::AJAX"></a>';
        $show['ajax_js'] = true;
    } else {
        $thread['openclose_editable'] = '';
    }
    /*if ($thread['postuserid'] == $vbulletin->userinfo['userid'])
    	{
    		$forumperms = fetch_permissions($thread['forumid']);
    		if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canopenclose'])
    		{
    			$thread['openclose_editable'] .= "<div><strong>Own thread</strong></div>";
    		}
    	}*/
    if ($allowicons == -1) {
        $allowicons = $vbulletin->forumcache["{$thread['forumid']}"]['options'] & $vbulletin->bf_misc_forumoptions['allowicons'];
    }
    if ($lastread == -1) {
        $lastread = $vbulletin->userinfo['lastvisit'];
    }
    $show['rexpires'] = $show['rmanage'] = $show['threadmoved'] = $show['paperclip'] = $show['unsubscribe'] = false;
    // thread forumtitle
    if (empty($thread['forumtitle'])) {
        $thread['forumtitle'] = $vbulletin->forumcache["{$thread['forumid']}"]['title'];
    }
    // word wrap title
    if ($vbulletin->options['wordwrap'] != 0) {
        $thread['threadtitle'] = fetch_word_wrapped_string($thread['threadtitle']);
    }
    $thread['threadtitle'] = fetch_censored_text($thread['threadtitle']);
    if ($thread['prefixid']) {
        $thread['prefix_plain_html'] = htmlspecialchars_uni($vbphrase["prefix_{$thread['prefixid']}_title_plain"]);
        $thread['prefix_rich'] = $vbphrase["prefix_{$thread['prefixid']}_title_rich"];
    } else {
        $thread['prefix_plain_html'] = '';
        $thread['prefix_rich'] = '';
    }
    // format thread preview if there is one
    if ($ignore["{$thread['postuserid']}"]) {
        $thread['preview'] = '';
    } else {
        if (isset($thread['preview']) and $vbulletin->options['threadpreview'] > 0) {
            $thread['preview'] = strip_quotes($thread['preview']);
            $thread['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(strip_bbcode($thread['preview'], false, true), $vbulletin->options['threadpreview'])));
        }
    }
    // thread last reply date/time
    $thread['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $thread['lastpost'], true);
    $thread['lastposttime'] = vbdate($vbulletin->options['timeformat'], $thread['lastpost']);
    // post reply date/time (for search results as posts mainly)
    if ($thread['postdateline']) {
        $thread['postdate'] = vbdate($vbulletin->options['dateformat'], $thread['postdateline'], true);
        $thread['posttime'] = vbdate($vbulletin->options['timeformat'], $thread['postdateline']);
    } else {
        $thread['postdate'] = '';
        $thread['posttime'] = '';
    }
    // thread not moved
    if ($thread['open'] != 10) {
        // allow ratings?
        if ($foruminfo['allowratings']) {
            // show votes?
            if ($thread['votenum'] and $thread['votenum'] >= $vbulletin->options['showvotes']) {
                $thread['voteavg'] = vb_number_format($thread['votetotal'] / $thread['votenum'], 2);
                $thread['rating'] = intval(round($thread['votetotal'] / $thread['votenum']));
            } else {
                $thread['rating'] = 0;
            }
        } else {
            $thread['rating'] = 0;
            $thread['votenum'] = 0;
        }
        // moderated thread?
        if (!$thread['visible']) {
            $thread['moderatedprefix'] = $vbphrase['moderated_thread_prefix'];
            $thread['checkbox_value'] += THREAD_FLAG_INVISIBLE;
        } else {
            $thread['moderatedprefix'] = '';
//.........这里部分代码省略.........
开发者ID:holandacz,项目名称:nb4,代码行数:101,代码来源:functions_forumdisplay.php

示例11: vB_Group_Bit_Factory

         $show['unapprove'] = false;
     }
 }
 // Create bit factory
 $bitfactory = new vB_Group_Bit_Factory($vbulletin, $itemtype);
 // Build message bits for all items
 $messagebits = '';
 while ($item = $collection->fetch_item()) {
     if (!$do_discussions) {
         $discussion = fetch_socialdiscussioninfo($item['discussionid']);
         $group = fetch_socialgroupinfo($discussion['groupid']);
     } else {
         $group = fetch_socialgroupinfo($item['groupid']);
     }
     // add group name to message
     $group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
     // force items to be visible
     if ('new' != $type) {
         $item['state'] = 'visible';
     }
     $bit =& $bitfactory->create($item, $group);
     $messagebits .= $bit->construct();
 }
 unset($bitfactory, $bit);
 // Set counts for view
 list($first, $last, $messageshown, $messagetotal) = array_values($collection->fetch_counts());
 // Legacy for templates
 $show['havemessages'] = (bool) $messagetotal;
 // Get actual resolved page number in case input was normalised
 $pagenumber = $show['pagenumber'] = $collection->fetch_pagenumber();
 $quantity = $collection->fetch_quantity();
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:moderation.php

示例12: prepare_socialgroup

/**
 * Takes information regardign a group, and prepares the information within it
 * for display
 *
 * @param	array	Group Array
 * @param	bool	Whether to fetch group members and avatars
 *
 * @return	array	Group Array with prepared information
 *
 */
function prepare_socialgroup($group, $fetchmembers = false)
{
    global $vbulletin;
    if (!is_array($group)) {
        return array();
    }
    if ($fetchmembers) {
        $membersinfo = cache_group_members();
        $group['membersinfo'] = $membersinfo[$group['groupid']];
    }
    $group['joindate'] = !empty($group['joindate']) ? vbdate($vbulletin->options['dateformat'], $group['joindate'], true) : '';
    $group['createtime'] = !empty($group['createdate']) ? vbdate($vbulletin->options['timeformat'], $group['createdate'], true) : '';
    $group['createdate'] = !empty($group['createdate']) ? vbdate($vbulletin->options['dateformat'], $group['createdate'], true) : '';
    $group['lastupdatetime'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['timeformat'], $group['lastupdate'], true) : '';
    $group['lastupdatedate'] = !empty($group['lastupdate']) ? vbdate($vbulletin->options['dateformat'], $group['lastupdate'], true) : '';
    $group['visible'] = vb_number_format($group['visible']);
    $group['moderation'] = vb_number_format($group['moderation']);
    $group['members'] = vb_number_format($group['members']);
    $group['moderatedmembers'] = vb_number_format($group['moderatedmembers']);
    $group['categoryname'] = htmlspecialchars_uni($group['categoryname']);
    $group['discussions'] = vb_number_format($group['discussions']);
    $group['lastdiscussion'] = fetch_word_wrapped_string(fetch_censored_text($group['lastdiscussion']));
    $group['trimdiscussion'] = fetch_trimmed_title($group['lastdiscussion']);
    if (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['enable_group_albums'])) {
        // albums disabled in this group - force 0 pictures
        $group['picturecount'] = 0;
    }
    $group['rawpicturecount'] = $group['picturecount'];
    $group['picturecount'] = vb_number_format($group['picturecount']);
    $group['rawname'] = $group['name'];
    $group['rawdescription'] = $group['description'];
    $group['name'] = fetch_word_wrapped_string(fetch_censored_text($group['name']));
    if ($group['description']) {
        $group['shortdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 185)));
    } else {
        $group['shortdescription'] = $group['name'];
    }
    $group['mediumdescription'] = fetch_word_wrapped_string(fetch_censored_text(fetch_trimmed_title($group['description'], 1000)));
    $group['description'] = nl2br(fetch_word_wrapped_string(fetch_censored_text($group['description'])));
    $group['is_owner'] = $group['creatoruserid'] == $vbulletin->userinfo['userid'];
    $group['is_automoderated'] = ($group['options'] & $vbulletin->bf_misc_socialgroupoptions['owner_mod_queue'] and $vbulletin->options['sg_allow_owner_mod_queue'] and !$vbulletin->options['social_moderation']);
    $group['canviewcontent'] = (!($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view']) or !$vbulletin->options['sg_allow_join_to_view'] or $group['membertype'] == 'member' or can_moderate(0, 'canmoderategroupmessages') or can_moderate(0, 'canremovegroupmessages') or can_moderate(0, 'candeletegroupmessages') or fetch_socialgroup_perm('canalwayspostmessage') or fetch_socialgroup_perm('canalwascreatediscussion'));
    $group['lastpostdate'] = vbdate($vbulletin->options['dateformat'], $group['lastpost'], true);
    $group['lastposttime'] = vbdate($vbulletin->options['timeformat'], $group['lastpost']);
    $group['lastposterid'] = $group['canviewcontent'] ? $group['lastposterid'] : 0;
    $group['lastposter'] = $group['canviewcontent'] ? $group['lastposter'] : '';
    // check read marking
    //remove notice and make readtime determination a bit more clear
    if (!empty($group['readtime'])) {
        $readtime = $group['readtime'];
    } else {
        $readtime = fetch_bbarray_cookie('group_marking', $group['groupid']);
        if (!$readtime) {
            $readtime = $vbulletin->userinfo['lastvisit'];
        }
    }
    // get thumb url
    $group['iconurl'] = fetch_socialgroupicon_url($group, true);
    // check if social group is moderated to join
    $group['membermoderated'] = 'moderated' == $group['type'];
    // posts older than markinglimit days won't be highlighted as new
    $oldtime = TIMENOW - $vbulletin->options['markinglimit'] * 24 * 60 * 60;
    $readtime = max((int) $readtime, $oldtime);
    $group['readtime'] = $readtime;
    $group['is_read'] = $readtime >= $group['lastpost'];
    // Legacy Hook 'group_prepareinfo' Removed //
    return $group;
}
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:78,代码来源:functions_socialgroup.php

示例13: verify_cleantext

 /**
  * Verify a clean (no markup) bit of text
  *
  * @param	string	Text
  */
 function verify_cleantext(&$clean_text)
 {
     $clean_text = trim(preg_replace('/&#(0*32|x0*20);/', ' ', $clean_text));
     // censor, remove all caps subjects
     require_once DIR . '/includes/functions_newpost.php';
     $clean_text = fetch_no_shouting_text(fetch_censored_text($clean_text));
     // do word wrapping
     if ($this->registry->options['wordwrap'] != 0) {
         $clean_text = fetch_word_wrapped_string($clean_text);
     }
     return true;
 }
开发者ID:holandacz,项目名称:nb4,代码行数:17,代码来源:class_dm_pt_issue.php

示例14: set_usertitle

 /**
  * Sets the values for user[usertitle] and user[customtitle]
  *
  * @param	string	Custom user title text
  * @param	boolean	Whether or not to reset a custom title to the default user title
  * @param	array	Array containing all information for the user's primary usergroup
  * @param	boolean	Whether or not a user can use custom user titles ($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusecustomtitle'])
  * @param	boolean	Whether or not the user is an administrator ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])
  */
 function set_usertitle($customtext, $reset, $usergroup, $canusecustomtitle, $isadmin)
 {
     $customtitle = $this->existing['customtitle'];
     $usertitle = $this->existing['usertitle'];
     if ($canusecustomtitle) {
         // user is allowed to set a custom title
         if ($reset or $customtitle == 0 and $customtext === '') {
             // reset custom title or we don't have one but are allowed to
             if (empty($usergroup['usertitle'])) {
                 $gettitle = $this->dbobject->query_first("\n\t\t\t\t\t\tSELECT title\n\t\t\t\t\t\tFROM " . TABLE_PREFIX . "usertitle\n\t\t\t\t\t\tWHERE minposts <= " . intval($this->existing['posts']) . "\n\t\t\t\t\t\tORDER BY minposts DESC\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t");
                 $usertitle = $gettitle['title'];
             } else {
                 $usertitle = $usergroup['usertitle'];
             }
             $customtitle = 0;
         } else {
             if ($customtext) {
                 // set custom text
                 $usertitle = fetch_censored_text($customtext);
                 if (!can_moderate() or can_moderate() and !$this->registry->options['ctCensorMod']) {
                     $usertitle = $this->censor_custom_title($usertitle);
                 }
                 $customtitle = $isadmin ? 1 : 2;
                 // regular user - run htmlspecialchars
                 if ($customtitle == 2) {
                     $usertitle = fetch_word_wrapped_string($usertitle, 25);
                 }
             }
         }
     } else {
         if ($customtitle != 1) {
             if (empty($usergroup['usertitle'])) {
                 $gettitle = $this->dbobject->query_first("\n\t\t\t\t\tSELECT title\n\t\t\t\t\tFROM " . TABLE_PREFIX . "usertitle\n\t\t\t\t\tWHERE minposts <= " . intval($this->existing['posts']) . "\n\t\t\t\t\tORDER BY minposts DESC\n\t\t\t\t\tLIMIT 1\n\t\t\t\t");
                 $usertitle = $gettitle['title'];
             } else {
                 $usertitle = $usergroup['usertitle'];
             }
             $customtitle = 0;
         }
     }
     $this->set('usertitle', $usertitle);
     $this->set('customtitle', $customtitle);
 }
开发者ID:holandacz,项目名称:nb4,代码行数:52,代码来源:class_dm_user.php

示例15: if

	else if ($ignore["$post[userid]"])
	{
		$show['adminignore'] = false;
		$bit_template = 'printthreadbit_ignore';
	}
	else
	{
		$bit_template = 'printthreadbit';
	}

	$post['postdate'] = vbdate($vbulletin->options['dateformat'], $post['dateline']);
	$post['posttime'] = vbdate($vbulletin->options['timeformat'], $post['dateline']);

	if ($vbulletin->options['wordwrap'])
	{
		$post['title'] = fetch_word_wrapped_string($post['title']);
	}

	if (!$post['userid'])
	{
		$post['username'] = $post['postusername'];
	}

	$post['message'] = $bbcode_parser->parse($post['pagetext'], 'nonforum', false);

	($hook = vBulletinHook::fetch_hook('printthread_post')) ? eval($hook) : false;

	$templater = vB_Template::create($bit_template);
	$templater->register('post', $post);
	$templater->register('xhtml_id', ++$xhtml);
	$postbits .= $templater->render();
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:printthread.php


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