Skip to content

Commit

Permalink
QSFP Version 1.3.5
Browse files Browse the repository at this point in the history
Recommit for 1.3.5.
  • Loading branch information
Arthmoor committed Nov 16, 2014
1 parent 30664ca commit 75de114
Show file tree
Hide file tree
Showing 466 changed files with 1,663 additions and 1,525 deletions.
10 changes: 5 additions & 5 deletions admincp/admin.php
Expand Up @@ -89,7 +89,7 @@ function set_table()
function message($title, $message, $link_text = null, $link = null, $redirect = null)
{
if ($link_text) {
$message .= "<br /><br /><a href='$link'>$link_text</a>";
$message .= "<br /><br /><a href=\"$link\">$link_text</a>";
}

if ($redirect) {
Expand Down Expand Up @@ -181,17 +181,17 @@ function get_lang($lang, $a = null, $path = '../', $main = true)

function list_groups($val, $select = 'user_group', $custom_only = false)
{
$out = "<select name='$select'>";
$out = "<select name=\"$select\">";

if ($custom_only) {
$groups = $this->db->query('SELECT group_name, group_id FROM %pgroups WHERE group_type="" ORDER BY group_name');
$groups = $this->db->query("SELECT group_name, group_id FROM %pgroups WHERE group_type='' ORDER BY group_name");
} else {
$groups = $this->db->query('SELECT group_name, group_id FROM %pgroups ORDER BY group_name');
$groups = $this->db->query("SELECT group_name, group_id FROM %pgroups ORDER BY group_name");
}

while ($group = $this->db->nqfetch($groups))
{
$out .= "<option value='{$group['group_id']}'" . (($val == $group['group_id']) ? ' selected=\'selected\'' : '') . ">" . htmlspecialchars($group['group_name']) . "</option>";
$out .= "<option value=\"{$group['group_id']}\"" . (($val == $group['group_id']) ? ' selected=\"selected\"' : '') . ">" . htmlspecialchars($group['group_name']) . "</option>";
}

return $out . '</select>';
Expand Down
2 changes: 1 addition & 1 deletion admincp/sources/ban.php
Expand Up @@ -62,7 +62,7 @@ function execute()

$banned = null;

$banned_query = $this->db->query('SELECT user_name FROM %pusers WHERE user_group=%d ORDER BY user_name ASC', USER_BANNED);
$banned_query = $this->db->query("SELECT user_name FROM %pusers WHERE user_group=%d ORDER BY user_name ASC", USER_BANNED);
while ($user = $this->db->nqfetch($banned_query))
{
$banned .= htmlspecialchars($user['user_name']) . "<br />";
Expand Down
2 changes: 1 addition & 1 deletion admincp/sources/forums.php
Expand Up @@ -54,7 +54,7 @@ function execute()
$this->get['s'] = '';
}

$forums_exist = $this->db->fetch('SELECT COUNT(forum_id) AS count FROM %pforums');
$forums_exist = $this->db->fetch("SELECT COUNT(forum_id) AS count FROM %pforums");

if (!$forums_exist['count'] && ($this->get['s'] != 'add')) {
return $this->message($this->lang->forum_controls, $this->lang->forum_none, $this->lang->forum_create, "$this->self?a=forums&amp;s=add");
Expand Down
4 changes: 2 additions & 2 deletions admincp/sources/groups.php
Expand Up @@ -65,7 +65,7 @@ function execute()
return $this->message($this->lang->groups_create, "
<form action='{$this->self}?a=groups&amp;s=add' method='post'><div>
{$this->lang->groups_create_new} <input class='input' name='group_name' /> {$this->lang->groups_based_on} " . $this->list_groups(USER_MEMBER) . "
<input type='submit' name='submit' value='Submit' /></div>
<input type='submit' name='submit' value='{$this->lang->submit}' /></div>
</form>");
} else {
if (!isset($this->post['user_group'])) {
Expand Down Expand Up @@ -98,7 +98,7 @@ function execute()
</form>");
} else {
if (!isset($this->post['group'])) {
return $this->message($this->lang->groups_edit, 'No group was specified.');
return $this->message($this->lang->groups_edit, $this->lang->groups_no_group);
}

$this->post['group'] = intval($this->post['group']);
Expand Down
2 changes: 1 addition & 1 deletion admincp/sources/mass_mail.php
Expand Up @@ -87,7 +87,7 @@ function send_mail()
if (count($this->post['groups'])) {
$members = $this->db->query("SELECT user_email FROM %pusers WHERE user_group IN (%s)", implode(', ', $this->post['groups']));
} else {
$members = $this->db->query("SELECT user_email FROM %pusers WHERE user_id != %d", USER_GUEST_UID);
$members = $this->db->query("SELECT user_email FROM %pusers WHERE user_id !=%d", USER_GUEST_UID);
}
while ($sub = $this->db->nqfetch($members))
{
Expand Down
10 changes: 5 additions & 5 deletions admincp/sources/member_control.php
Expand Up @@ -146,7 +146,7 @@ function execute()
$this->get['id'] = intval($this->get['id']);

if (!isset($this->post['submit'])) {
$member = $this->db->fetch('SELECT * FROM %pusers WHERE user_id=%d LIMIT 1', $this->get['id']);
$member = $this->db->fetch("SELECT * FROM %pusers WHERE user_id=%d", $this->get['id']);

$this->iterator_init('tablelight', 'tabledark');
$out = "";
Expand Down Expand Up @@ -279,7 +279,7 @@ function execute()

return eval($this->template('ADMIN_MEMBER_PROFILE'));
} else {
$member = $this->db->fetch('SELECT user_name FROM %pusers WHERE user_id=%d LIMIT 1', $this->get['id']);
$member = $this->db->fetch("SELECT user_name FROM %pusers WHERE user_id=%d", $this->get['id']);
$guest_email = $this->post['user_email'];
if ($member['user_name'] != 'Guest' && !$this->validator->validate($guest_email, TYPE_EMAIL)) {
return $this->message($this->lang->mc_err_updating, $this->lang->mc_email_invaid);
Expand Down Expand Up @@ -325,7 +325,7 @@ function execute()
$user_avatar_height = intval($this->post['user_avatar_height']);
$user_level = intval($this->post['user_level']);
$user_birthday = $this->post['user_birthday'];
$user_timezone = intval($this->post['user_timezone']);
$user_timezone = $this->post['user_timezone'];
$user_location = $this->format($this->post['user_location'], FORMAT_HTMLCHARS);
$user_homepage = $this->format($this->post['user_homepage'], FORMAT_HTMLCHARS);
$user_interests = $this->format($this->post['user_interests'], FORMAT_HTMLCHARS);
Expand All @@ -347,7 +347,7 @@ function execute()
$this->db->query( "UPDATE %pusers SET user_name='%s', user_group=%d, user_title='%s',
user_title_custom=%d, user_language='%s', user_skin='%s', user_avatar='%s',
user_avatar_type='%s', user_avatar_width=%d, user_avatar_height=%d, user_level=%d,
user_birthday='%s', user_timezone=%d, user_location='%s', user_homepage='%s',
user_birthday='%s', user_timezone='%s', user_location='%s', user_homepage='%s',
user_interests='%s', user_signature='%s', user_posts=%d, user_uploads=%d,
user_icq=%d, user_msn='%s', user_aim='%s', user_gtalk='%s', user_yahoo='%s',
user_email_show=%d, user_pm=%d, user_pm_mail=%d, user_view_avatars=%d,
Expand Down Expand Up @@ -377,7 +377,7 @@ function execute()
function list_skins($val)
{
$out = "<select name='user_skin'>";
$groups = $this->db->query('SELECT skin_name, skin_dir FROM %pskins ORDER BY skin_name');
$groups = $this->db->query("SELECT skin_name, skin_dir FROM %pskins ORDER BY skin_name");

while ($group = $this->db->nqfetch($groups))
{
Expand Down
20 changes: 10 additions & 10 deletions admincp/sources/perms.php
Expand Up @@ -75,7 +75,7 @@ function execute()
$this->set_title($title);
$this->tree($title);

$forums_only = $this->db->query('SELECT forum_id, forum_name FROM %pforums ORDER BY forum_name');
$forums_only = $this->db->query("SELECT forum_id, forum_name FROM %pforums ORDER BY forum_name");

$forums_list = array();
while ($forum = $this->db->nqfetch($forums_only))
Expand All @@ -88,12 +88,12 @@ function execute()
'board_view_closed' => $this->lang->perms_board_view_closed,
'do_anything' => $this->lang->perms_do_anything,
'is_admin' => $this->lang->perms_is_admin,
'edit_avatar' => 'Can edit user avatar',
'edit_profile' => 'Can edit user profile',
'edit_sig' => 'Can edit signatures',
'page_edit' => 'Can edit custom pages', // Added for CMS
'page_create' => 'Can create custom pages', // Added for CMS
'page_delete' => 'Can delete custom pages', // Added for CMS
'edit_avatar' => $this->lang->perms_edit_avatar,
'edit_profile' => $this->lang->perms_edit_profile,
'edit_sig' => $this->lang->perms_edit_sig,
'page_edit' => $this->lang->perms_edit_pages, // Added for CMS
'page_create' => $this->lang->perms_create_pages, // Added for CMS
'page_delete' => $this->lang->perms_delete_pages, // Added for CMS
'email_use' => $this->lang->perms_email_use,
'topic_global' => $this->lang->perms_topic_global,
'pm_noflood' => $this->lang->perms_pm_noflood,
Expand Down Expand Up @@ -140,10 +140,10 @@ function execute()

if ($mode == 'user') {
$query = $this->db->fetch("SELECT user_name, user_perms FROM %pusers WHERE user_id=%d", $this->post['group']);
$label = "User '{$query['user_name']}'";
$label = "{$this->lang->perms_user} '{$query['user_name']}'";
} else {
$query = $this->db->fetch("SELECT group_name FROM %pgroups WHERE group_id=%d", $this->post['group']);
$label = "Group '{$query['group_name']}'";
$label = "{$this->lang->perms_group} '{$query['group_name']}'";
}

$out = "
Expand Down Expand Up @@ -225,7 +225,7 @@ function areallchecked(element)
</script>
<form id='form' action='$this->self?a=perms$link' method='post'>
<div align='center'><span style='font-size:14px;'><b>Permissions For $label</b></span>";
<div align='center'><span style='font-size:14px;'><b>" . $this->lang->perms_for . " $label</b></span>";

if ($mode == 'user') {
$out .= "<br />{$this->lang->perms_override_user}<br /><br />
Expand Down
12 changes: 6 additions & 6 deletions admincp/sources/prune.php
Expand Up @@ -148,22 +148,22 @@ function delete_topic($t)
while ($post = $this->db->nqfetch($posts))
{
if ($post['post_count']) {
$this->db->query('UPDATE %pusers SET user_posts=user_posts-1 WHERE user_id=%d', $post['post_author']);
$this->db->query("UPDATE %pusers SET user_posts=user_posts-1 WHERE user_id=%d", $post['post_author']);
}

if ($post['attach_file']) {
$this->db->query('DELETE FROM %pattach WHERE attach_post=%d', $post['post_id']);
$this->db->query("DELETE FROM %pattach WHERE attach_post=%d", $post['post_id']);
@unlink('./attachments/' . $post['attach_file']);
}

$deleted++;
}

$result = $this->db->fetch('SELECT topic_forum FROM %ptopics WHERE topic_id=%d', $t);
$result = $this->db->fetch("SELECT topic_forum FROM %ptopics WHERE topic_id=%d", $t);

$this->db->query('DELETE FROM %pvotes WHERE vote_topic=%d', $t);
$this->db->query('DELETE FROM %ptopics WHERE topic_id=%d OR topic_moved=%d', $t, $t);
$this->db->query('DELETE FROM %pposts WHERE post_topic=%d', $t);
$this->db->query("DELETE FROM %pvotes WHERE vote_topic=%d", $t);
$this->db->query("DELETE FROM %ptopics WHERE topic_id=%d OR topic_moved=%d", $t, $t);
$this->db->query("DELETE FROM %pposts WHERE post_topic=%d", $t);

$this->db->query("UPDATE %pforums SET forum_topics=forum_topics-1, forum_replies=forum_replies-%d WHERE forum_id=%d", $deleted, $result['topic_forum']);
}
Expand Down
2 changes: 1 addition & 1 deletion admincp/sources/query.php
Expand Up @@ -56,7 +56,7 @@ function execute()
if (!isset($this->post['submit'])) {
return $this->message($this->lang->query, "
<form action='{$this->self}?a=query' method='post'><div>
<textarea class='input' name='sql' cols='30' rows='15' style='width:100%'>SELECT * FROM {$this->pre}groups</textarea><br /><br />
<textarea class='input' name='sql' cols='30' rows='15' style='width:100%'>SELECT * FROM %pgroups</textarea><br /><br />
<input type='submit' name='submit' value='{$this->lang->submit}' /></div>
</form>");
} else {
Expand Down
7 changes: 3 additions & 4 deletions admincp/sources/templates.php
Expand Up @@ -62,6 +62,7 @@ function execute()
'member_control' => $this->lang->temps_member_control,
'members' => $this->lang->temps_members,
'mod' => $this->lang->temps_mod,
'newspost' => $this->lang->temps_newspost,
'pm' => $this->lang->temps_pm,
'poll' => $this->lang->temps_polls,
'post' => $this->lang->temps_post,
Expand Down Expand Up @@ -184,7 +185,7 @@ function upgrade_skin($skin)
$didsomething = false;

/* find missing templates and dump code from default */
$sql = "SELECT * FROM %ptemplates WHERE template_skin = 'default'";
$sql = "SELECT * FROM %ptemplates WHERE template_skin='default'";
$query = $this->db->query($sql);

while ($row = $this->db->nqfetch($query))
Expand All @@ -203,7 +204,7 @@ function upgrade_skin($skin)
}

/* Iterate over all our templates */
$query = $this->db->query("SELECT template_html, template_name FROM %ptemplates WHERE template_skin = '%s'", $skin);
$query = $this->db->query("SELECT template_html, template_name FROM %ptemplates WHERE template_skin='%s'", $skin);

while ($row = $this->db->nqfetch($query))
{
Expand Down Expand Up @@ -938,8 +939,6 @@ function edit_section($sections, $skins, $template)
}
}

//$val = preg_replace('/\{lang-(.+?)\}/', '{$this->lang->\\1}', $val);

$this->db->query("UPDATE %ptemplates SET template_html='%s' WHERE template_skin='%s' AND template_name='%s' AND template_set='%s'",
$val, $template, $var, $this->get['section']);
}
Expand Down
31 changes: 31 additions & 0 deletions alternate_robots.txt
@@ -0,0 +1,31 @@
# Tune the indexing of pages.
# Blocking things the bots don't need to know about can help improve content indexing.
# Some links such as the page navigation links for multi-page topics don't need indexing because they'll duplicate content.

User-agent: *
Disallow: /index.php?a=post
Disallow: /index.php?a=search
Disallow: /index.php?a=members
Disallow: /index.php?a=help
Disallow: /index.php?a=pm
Disallow: /index.php?a=cp
Disallow: /index.php?a=active
Disallow: /index.php?a=email
Disallow: /index.php?a=filerating
Disallow: /index.php?a=register
Disallow: /index.php?a=login
Disallow: /index.php?a=recent
Disallow: /index.php?a=board&s=mark
Disallow: /index.php?a=files&s=search
Disallow: /index.php?a=files&s=download
Disallow: /index.php?a=files&s=addcomment
Disallow: /index.php?a=topic&s=attach
Disallow: /*view=newer$
Disallow: /*view=older$
Disallow: /*order=*asc=*

User-agent: Googlebot-Image
Disallow: /

User-agent: WebReaper
Disallow: /
2 changes: 0 additions & 2 deletions defaultutils.php
Expand Up @@ -42,8 +42,6 @@
$modules['mailer'] = 'mailer';
require_once $set['include_path'] . '/lib/attachutil.php';
$modules['attach'] = 'attachutil';
require_once $set['include_path'] . '/lib/tz_decode2.php';
$modules['timezone'] = 'tz_decode2';
require_once $set['include_path'] . '/lib/htmlwidgets.php';
$modules['widgets'] = 'htmlwidgets';
require_once $set['include_path'] . '/lib/templater.php';
Expand Down
15 changes: 15 additions & 0 deletions docs/CHANGES.txt
@@ -1,6 +1,21 @@
QSF Portal Changes
------------------

Changes for 1.3.5:

* Cleaned up member profile HTML.
* Redirect after marking forums/board as read will use the URL from the AdminCP settings.
* Added the ability to comment on news posts, and the use of a "more" link.
* Overall code pruning and cleanup.
* Better robots.txt handling by default. Inclusion of more restrictive optional robots file.
* Support for Youtube, Google, and Brightcove video embedding in posts.
* Removed detailed DST support. PHP date() function has sufficient support for general DST accuracy.

Bugs addressed:

* Links to mark forums as read don't actually work.
* BBcode crash if an invalid tag is only one character. Such as [1].

Changes for 1.3.4:

* Cosmetic improvements to the file module templates.
Expand Down
27 changes: 2 additions & 25 deletions func/board.php
Expand Up @@ -73,11 +73,11 @@ function execute()
$this->readmarker->mark_forum_read($forum_id, $this->time);
return $this->message($this->lang->board_markforum,
sprintf($this->lang->board_markforum1, $forum_name),
$this->lang->continue, $this->self, $this->self);
$this->lang->continue, $this->self . "?a=forum&amp;f={$forum_id}", $this->self . "?a=forum&f={$forum_id}");
}
} else {
$this->readmarker->mark_all_read($this->time);
return $this->message($this->lang->board_mark, $this->lang->board_mark1, $this->lang->continue, $this->self, $this->self);
return $this->message($this->lang->board_mark, $this->lang->board_mark1, $this->lang->continue, $this->sets['loc_of_board'], $this->sets['loc_of_board']);
}
} else {
$this->get['s'] = null;
Expand Down Expand Up @@ -150,35 +150,12 @@ function getForums($forums, $c)
$forum['forum_topics'] = number_format($forum['forum_topics'], 0, null, $this->lang->sep_thousands);
$forum['forum_replies'] = number_format($forum['forum_replies'], 0, null, $this->lang->sep_thousands);

if ($this->perms->auth('topic_view', $forum['forum_id'])) {
if ($this->perms->auth('topic_create', $forum['forum_id'])) {
$topic_perms = "<a href=\"{$this->self}?a=post&amp;s=topic&amp;f={$forum['forum_id']}\"><img src=\"./skins/{$this->skin}/images/topic_write.png\" alt=\"{$this->lang->board_write_topics}\" title=\"{$this->lang->board_write_topics}\" /></a>";
} else {
$topic_perms = "<img src='./skins/{$this->skin}/images/topic_read.png' alt='{$this->lang->board_can_topics}' title='{$this->lang->board_can_topics}' />";
}

if ($this->perms->auth('post_create', $forum['forum_id'])) {
$post_perms = "<img src='./skins/{$this->skin}/images/post_write.png' alt='{$this->lang->board_can_post}' title='{$this->lang->board_can_post}' />";
} else {
$post_perms = "<img src='./skins/{$this->skin}/images/post_read.png' alt='{$this->lang->board_cant_post}' title='{$this->lang->board_cant_post}' />";
}
} else {
$topic_perms = "<img src='./skins/{$this->skin}/images/topic_none.png' alt='{$this->lang->board_cant_topics}' title='{$this->lang->board_cant_topics}' />";
$post_perms = "<img src='./skins/{$this->skin}/images/post_read.png' alt='{$this->lang->board_cant_post}' title='{$this->lang->board_cant_post}' />";
}

$topic_new = "<img src='./skins/{$this->skin}/images/topic_old.png' alt='{$this->lang->main_topics_old}' title='{$this->lang->main_topics_old}' />";
$topic_unread = false;
$forum_unread = !$this->readmarker->is_forum_read($forum['forum_id'], $forum['LastTime']);

if ($forum['forum_lastpost']) {
$topic_unread = !$this->readmarker->is_topic_read($forum['LastTopicID'], $forum['LastTime']);
if ($topic_unread) {
$topic_new = "<a href=\"{$this->self}?s=mark&amp;f={$forum['forum_id']}\"><img src=\"./skins/{$this->skin}/images/topic_new.png\" alt=\"{$this->lang->main_topics_new}\" title=\"{$this->lang->main_topics_new}\" /></a>";
}

$forum['TopicLastTime'] = $forum['LastTime']; // store so skins can access

$forum['LastTime'] = $this->mbdate(DATE_LONG, $forum['LastTime']);

if ($forum['user_lastposterID'] != USER_GUEST_UID) {
Expand Down

0 comments on commit 75de114

Please sign in to comment.