<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* @author Simple Machines http://www.simplemachines.org
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0.14
*/
if (!defined('SMF'))
die('Hacking attempt...');
/* This file has all the main functions in it that relate to, well,
everything. It provides all of the following functions:
void updateStats(string statistic, string condition = '1')
- statistic can be 'member', 'message', 'topic', or 'postgroups'.
- parameter1 and parameter2 are optional, and are used to update only
those stats that need updating.
- the 'member' statistic updates the latest member, the total member
count, and the number of unapproved members.
- 'member' also only counts approved members when approval is on, but
is much more efficient with it off.
- updating 'message' changes the total number of messages, and the
highest message id by id_msg - which can be parameters 1 and 2,
respectively.
- 'topic' updates the total number of topics, or if parameter1 is true
simply increments them.
- the 'postgroups' case updates those members who match condition's
post-based membergroups in the database (restricted by parameter1).
void updateMemberData(int id_member, array data)
- updates the columns in the members table.
- id_member is either an int or an array of ints to be updated.
- data is an associative array of the columns to be updated and their
respective values.
- any string values updated should be quoted and slashed.
- the value of any column can be '+' or '-', which mean 'increment'
and decrement, respectively.
- if the member's post number is updated, updates their post groups.
- this function should be used whenever member data needs to be
updated in place of an UPDATE query.
void updateSettings(array changeArray, use_update = false)
- updates both the settings table and $modSettings array.
- all of changeArray's indexes and values are assumed to have escaped
apostrophes (')!
- if a variable is already set to what you want to change it to, that
variable will be skipped over; it would be unnecessary to reset.
- if use_update is true, UPDATEs will be used instead of REPLACE.
- when use_update is true, the value can be true or false to increment
or decrement it, respectively.
string constructPageIndex(string base_url, int &start, int max_value,
int num_per_page, bool compact_start = false)
- builds the page list, e.g. 1 ... 6 7 [8] 9 10 ... 15.
- compact_start caused it to use "url.page" instead of
"url;start=page".
- handles any wireless settings (adding special things to URLs.)
- very importantly, cleans up the start value passed, and forces it to
be a multiple of num_per_page.
- also checks that start is not more than max_value.
- base_url should be the URL without any start parameter on it.
- uses the compactTopicPagesEnable and compactTopicPagesContiguous
settings to decide how to display the menu.
- an example is available near the function definition.
string comma_format(float number)
- formats a number to display in the style of the admins' choosing.
- uses the format of number_format to decide how to format the number.
- for example, it might display "1 234,50".
- caches the formatting data from the setting for optimization.
string timeformat(int time, bool show_today = true, string offset_type = false)
- returns a pretty formated version of time based on the user's format
in $user_info['time_format'].
- applies all necessary time offsets to the timestamp, unless offset_type
is set.
- if todayMod is set and show_today was not not specified or true, an
alternate format string is used to show the date with something to
show it is "today" or "yesterday".
- performs localization (more than just strftime would do alone.)
string un_htmlspecialchars(string text)
- removes the base entities (<, ", etc.) from text.
- should be used instead of html_entity_decode for PHP version
compatibility reasons.
- additionally converts and '.
- returns the string without entities.
string shorten_subject(string regular_subject, int length)
- shortens a subject so that it is either shorter than length, or that
length plus an ellipsis.
- respects internationalization characters and entities as one character.
- avoids trailing entities.
- returns the shortened string.
int forum_time(bool use_user_offset = true)
- returns the current time with offsets.
- always applies the offset in the time_offset setting.
- if use_user_offset is true, applies the user's offset as well.
- returns seconds since the unix epoch.
array permute(array input)
- calculates all the possible permutations (orders) of array.
- should not be called on huge arrays (bigger than like 10 elements.)
- returns an array containing each permutation.
string parse_bbc(string message, bool smileys = true, string cache_id = '', array parse_tags = null)
- this very hefty function parses bbc in message.
- only parses bbc tags which are not disabled in disabledBBC.
- also handles basic HTML, if enablePostHTML is on.
- caches the from/to replace regular expressions so as not to reload
them every time a string is parsed.
- only parses smileys if smileys is true.
- does nothing if the enableBBC setting is off.
- applies the fixLongWords magic if the setting is set to on.
- uses the cache_id as a unique identifier to facilitate any caching
it may do.
- returns the modified message.
void parsesmileys(string &message)
- the smiley parsing function which makes pretty faces appear :).
- if custom smiley sets are turned off by smiley_enable, the default
set of smileys will be used.
- these are specifically not parsed in code tags [url=mailto:[email protected]]
- caches the smileys from the database or array in memory.
- doesn't return anything, but rather modifies message directly.
string highlight_php_code(string code)
- Uses PHP's highlight_string() to highlight PHP syntax
- does special handling to keep the tabs in the code available.
- used to parse PHP code from inside [code] and [php] tags.
- returns the code with highlighted HTML.
void writeLog(bool force = false)
// !!!
void redirectexit(string setLocation = '', bool use_refresh = false)
// !!!
void obExit(bool do_header = true, bool do_footer = do_header)
// !!!
int logAction($action, $extra = array())
// !!!
void trackStats($stats = array())
- caches statistics changes, and flushes them if you pass nothing.
- if '+' is used as a value, it will be incremented.
- does not actually commit the changes until the end of the page view.
- depends on the trackStats setting.
void spamProtection(string error_type)
- attempts to protect from spammed messages and the like.
- takes a $txt index. (not an actual string.)
- time taken depends on error_type - generally uses the modSetting.
array url_image_size(string url)
- uses getimagesize() to determine the size of a file.
- attempts to connect to the server first so it won't time out.
- returns false on failure, otherwise the output of getimagesize().
void determineTopicClass(array &topic_context)
// !!!
void setupThemeContext(bool force_reload = false)
// !!!
void template_rawdata()
// !!!
void template_header()
// !!!
void theme_copyright(bool get_it = false)
// !!!
void template_footer()
// !!!
void db_debug_junk()
// !!!
void getAttachmentFilename(string filename, int id_attach, bool new = true)
// !!!
array ip2range(string $fullip)
- converts a given IP string to an array.
- internal function used to convert a user-readable format to
a format suitable for the database.
- returns 'unknown' if the ip in the input was '255.255.255.255'.
string host_fro
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码—SMF论坛Simple Machines Forum.zip
共1056个文件
gif:618个
php:250个
png:70个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 138 浏览量
2022-11-12
13:01:46
上传
评论
收藏 2.3MB ZIP 举报
温馨提示
PHP实例开发源码—SMF论坛Simple Machines Forum.zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码—SMF论坛Simple Machines Forum.zip (1056个子文件)
index.css 55KB
index.css 54KB
compat.css 34KB
rtl.css 17KB
rtl.css 16KB
admin.css 9KB
ie6.css 3KB
ie7.css 2KB
install.css 1KB
ie6.css 1KB
report.css 770B
editor_ie.css 695B
editor.css 536B
wireless.css 503B
ie7.css 303B
webkit.css 283B
webkit.css 253B
Candice.gdf 27KB
President.gdf 21KB
Hootie.gdf 17KB
thumbnail.gif 5KB
thumbnail.gif 5KB
loading.gif 3KB
mirrortab_last.gif 2KB
admintab_right.gif 2KB
maintab_last.gif 2KB
mirrortab_first.gif 1KB
afro.gif 1KB
maintab_first.gif 1KB
mirrortab_first_prev.gif 1KB
cry.gif 1KB
police.gif 1KB
evil.gif 1KB
angel.gif 1KB
afro.gif 1KB
smiley.gif 1KB
shocked.gif 1KB
huh.gif 1KB
embarrassed.gif 1KB
tongue.gif 1KB
azn.gif 1KB
undecided.gif 1KB
kiss.gif 1KB
cool.gif 1KB
angry.gif 1KB
rolleyes.gif 1KB
laugh.gif 1KB
sad.gif 1KB
wink.gif 1KB
grin.gif 1KB
lipsrsealed.gif 1KB
cheesy.gif 1KB
maintab_first_prev.gif 1KB
cry.gif 1017B
cheesy.gif 1012B
shocked.gif 1012B
cheesy.gif 1012B
sad.gif 1009B
smiley.gif 1009B
sad.gif 1009B
smiley.gif 1009B
kiss.gif 1008B
embarrassed.gif 1008B
lipsrsealed.gif 1006B
tongue.gif 1005B
huh.gif 1005B
angry.gif 1004B
wink.gif 1004B
angry.gif 1004B
wink.gif 1004B
grin.gif 1001B
grin.gif 1001B
cool.gif 999B
mirrortab_last_prev.gif 981B
admintab_active_last.gif 956B
maintab_last_prev.gif 932B
im_switch.gif 895B
im_switch.gif 895B
clip.gif 875B
clip.gif 875B
redirect.gif 849B
subsection2.gif 840B
pm_recipient_delete.gif 840B
pm_recipient_delete.gif 840B
resize-handle.gif 827B
resize-handle.gif 827B
admintab_left.gif 820B
bbc_hoverbg.gif 811B
bbc_bg.gif 799B
move.gif 785B
move.gif 785B
smflogo.gif 776B
online.gif 709B
approve.gif 697B
approve.gif 697B
afro.gif 691B
police.gif 689B
police.gif 686B
hot_poll_locked_sticky.gif 682B
veryhot_poll_locked_sticky.gif 674B
共 1056 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
毕业_设计
- 粉丝: 1935
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功