Version 1.1.1

This commit is contained in:
Neo committed 2025-12-19 00:16:25 -08:00
1 parent aabfdc1f57
commit 7ef3d1712a
179 files changed
+57457 -44972

No files matched your search

+352 -45
View File
@@ -2,10 +2,10 @@
/*
+--------------------------------------------------------------------------
| IBFORUMS v1
| Invision Board v1.1
| ========================================
| by Matthew Mecham and David Baxter
| (c) 2001,2002 IBForums
| by Matthew Mecham
| (c) 2001,2002 Invision Power Services
| http://www.ibforums.com
| ========================================
| Web: http://www.ibforums.com
@@ -73,9 +73,7 @@ class UserCP {
require "./sources/lib/usercp_functions.php";
require "./Skin/".$ibforums->skin_id."/skin_ucp.php";
$this->html = new skin_ucp();
$this->html = $std->load_template('skin_ucp');
$this->base_url = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}?s={$ibforums->session_id}";
$this->base_url_nosess = "{$ibforums->vars['board_url']}/index.{$ibforums->vars['php_ext']}";
@@ -93,19 +91,16 @@ class UserCP {
// Get more member info..
$DB->query("SELECT * from ibf_members WHERE id='".$this->member['id']."'");
$DB->query("SELECT m.*, me.links, me.notes, me.ta_size
FROM ibf_members m
LEFT JOIN ibf_member_extra me ON(me.id=m.id)
WHERE m.id='".$this->member['id']."'");
$this->member = $DB->fetch_row();
//-----------------------------------------------
// Format the links if we have any
//-----------------------------------------------
$DB->query("SELECT links, notes, ta_size from ibf_member_extra WHERE id='".$this->member['id']."'");
$row = $DB->fetch_row();
$this->links = $row['links'];
$this->notes = $row['notes'];
$this->size = $row['ta_size'] ? $row['ta_size'] : $this->size;
$this->links = $this->member['links'];
$this->notes = $this->member['notes'];
$this->size = $this->member['ta_size'] ? $this->member['ta_size'] : $this->size;
// We have a single pull down menu for our "Quick Click" stuff
// The JS uses a simple split command to determine if the link
@@ -228,6 +223,13 @@ class UserCP {
$this->do_pass_change();
break;
//------------------------------
case '50':
$this->forum_tracker();
break;
case '51':
$this->remove_forum_tracker();
break;
default:
$this->splash();
break;
@@ -248,6 +250,115 @@ class UserCP {
}
//*******************************************************************/
//| Forum tracker
//|
//| What, you need a definition with that title?
//| What are you doing poking around in the code for anyway?
//*******************************************************************/
function remove_forum_tracker() {
global $ibforums, $std, $DB;
if ($ibforums->input['f'] == 'all')
{
$DB->query("DELETE FROM ibf_forum_tracker WHERE member_id='".$this->member['id']."'");
}
else
{
$id = intval($ibforums->input['f']);
$DB->query("DELETE FROM ibf_forum_tracker WHERE member_id='".$this->member['id']."' AND forum_id='$id'");
}
$std->boink_it($this->base_url."&act=UserCP&CODE=50");
}
function forum_tracker() {
global $ibforums, $DB, $std, $print;
$this->output .= $this->html->forum_subs_header();
//----------------------------------------------------------
// Query the DB for the subby toppy-ics - at the same time
// we get the forum and topic info, 'cos we rule.
//----------------------------------------------------------
$DB->query("SELECT t.frid, t.start_date, f.*, c.id as cat_id, c.name as cat_name
FROM ibf_forum_tracker t
LEFT JOIN ibf_forums f ON (t.forum_id=f.id)
LEFT JOIN ibf_categories c ON (c.id=f.category)
WHERE t.member_id='".$this->member['id']."'
ORDER BY c.position, f.position");
if ( $DB->get_num_rows() )
{
$last_cat_id = -1;
while( $forum = $DB->fetch_row() )
{
if ($last_cat_id != $forum['cat_id'])
{
$last_cat_id = $forum['cat_id'];
$this->output .= $this->html->subs_forum_row($forum['cat_id'], $forum['cat_name']);
}
$forum['last_post'] = $std->get_date($forum['last_post'], 'LONG');
$forum['last_topic'] = $ibforums->lang['f_none'];
$forum['last_title'] = str_replace( "!" , "!", $forum['last_title'] );
$forum['last_title'] = str_replace( """, "\"", $forum['last_title'] );
if (strlen($forum['last_title']) > 30)
{
$forum['last_title'] = substr($forum['last_title'],0,27) . "...";
$forum['last_title'] = preg_replace( '/&(#(\d+;?)?)?\.\.\.$/', '...', $forum['last_title'] );
}
if ($forum['password'] != "")
{
$forum['last_topic'] = $ibforums->lang['f_none'];
}
else
{
$forum['last_topic'] = "<a href='{$ibforums->base_url}&act=ST&f={$forum['id']}&t={$forum['last_id']}&view=getlastpost'>{$forum['last_title']}</a>";
}
if ( isset($forum['last_poster_name']))
{
$forum['last_poster'] = $forum['last_poster_id'] ? "<a href='{$ibforums->base_url}&act=Profile&CODE=03&MID={$forum['last_poster_id']}'>{$forum['last_poster_name']}</a>"
: $forum['last_poster_name'];
}
else
{
$forum['last_poster'] = $ibforums->lang['f_none'];
}
$forum['folder_icon'] = $std->forum_new_posts($forum);
$this->output .= $this->html->forum_subs_row($forum);
}
}
else
{
$this->output .= $this->html->forum_subs_none();
}
$this->output .= $this->html->forum_subs_end();
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array( "<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" );
}
//*******************************************************************/
//| pass change:
//|
@@ -310,7 +421,7 @@ class UserCP {
$DB->query("UPDATE ibf_members SET password='$md5_pass' WHERE id='".$this->member['id']."'");
$DB->query("UPDATE ibf_sessions SET member_pass='$md5_pass' WHERE id='".$this->session_id."' and member_id='".$this->member['id']."'");
//$DB->query("UPDATE ibf_sessions SET member_pass='$md5_pass' WHERE id='".$this->session_id."' and member_id='".$this->member['id']."'");
//--------------------------------------------
// Update the cookie..
@@ -409,7 +520,7 @@ class UserCP {
if ($ibforums->session_id)
{
$DB->query("UPDATE ibf_sessions SET member_name='', member_id='0', member_pass='', member_group='".$ibforums->vars['guest_group']."' WHERE member_id='".$this->member['id']."' and id='".$ibforums->session_id."'");
$DB->query("UPDATE ibf_sessions SET member_name='', member_id='0', member_group='".$ibforums->vars['guest_group']."' WHERE member_id='".$this->member['id']."' and id='".$ibforums->session_id."'");
}
// Kill the cookies to stop auto log in
@@ -459,6 +570,46 @@ class UserCP {
$this->output .= $this->html->subs_header();
//----------------------------------------------------------
// Are we checking for auto-prune?
//----------------------------------------------------------
$auto_explain = $ibforums->lang['no_auto_prune'];
if ($ibforums->vars['subs_autoprune'] > 0)
{
if ( time() % 2 )
{
// Every now and again..
$time_limit = time() - ($ibforums->vars['subs_autoprune'] * 86400);
$DB->query("SELECT tr.trid FROM ibf_tracker tr, ibf_topics t WHERE t.tid=tr.topic_id AND t.last_post < '$time_limit'");
$trids = array();
while ( $r = $DB->fetch_row() )
{
$trids[] = $r['trid'];
}
if (count($trids) > 0)
{
$DB->query("DELETE FROM ibf_tracker WHERE trid IN (".explode(",",$trids).")");
}
}
$auto_explain = sprintf( $ibforums->lang['auto_prune'], $ibforums->vars['subs_autoprune'] );
}
//----------------------------------------------------------
// Do we have an incoming date cut?
//----------------------------------------------------------
$date_cut = intval($ibforums->input['datecut']) != "" ? intval($ibforums->input['datecut']) : 30;
$date_query = $date_cut != 1000 ? " AND t.last_post > '".(time() - ($date_cut*86400))."' " : "";
//----------------------------------------------------------
// Query the DB for the subby toppy-ics - at the same time
// we get the forum and topic info, 'cos we rule.
@@ -466,15 +617,24 @@ class UserCP {
$DB->query("SELECT s.trid, s.member_id, s.topic_id, s.last_sent, s.start_date as track_started, t.*, f.id as forum_id, f.name as forum_name, f.read_perms "
."FROM ibf_tracker s, ibf_topics t, ibf_forums f "
."WHERE s.member_id='".$this->member['id']."' AND t.tid=s.topic_id AND f.id=t.forum_id "
."ORDER BY t.last_post DESC");
."WHERE s.member_id='".$this->member['id']."' AND t.tid=s.topic_id AND f.id=t.forum_id $date_query"
."ORDER BY f.id, t.last_post DESC");
if ( $DB->get_num_rows() )
{
$last_forum_id = -1;
while( $topic = $DB->fetch_row() )
{
if ($last_forum_id != $topic['forum_id'])
{
$last_forum_id = $topic['forum_id'];
$this->output .= $this->html->subs_forum_row($topic['forum_id'], $topic['forum_name']);
}
$topic['last_poster'] = ($topic['last_poster_id'] != 0)
? "<b><a href='{$this->base_url}&act=Profile&CODE=03&MID={$topic['last_poster_id']}'>{$topic['last_poster_name']}</a></b>"
: "-".$topic['last_poster_name']."-";
@@ -495,7 +655,7 @@ class UserCP {
if ($topic['pinned'])
{
$topic['topic_icon'] = $ibforums->skin['B_PIN'];
$topic['topic_icon'] = "<{B_PIN}>";
}
$topic['start_date'] = $std->get_date( $topic['track_started'], 'LONG' );
@@ -523,7 +683,7 @@ class UserCP {
}
if ($pages > 1) {
$topic['PAGES'] = "<span id='small'>({$ibforums->lang['topic_sp_pages']} ";
$topic['PAGES'] = "<span class='small'>({$ibforums->lang['topic_sp_pages']} ";
for ($i = 0 ; $i < $pages ; ++$i ) {
$real_no = $i * $ibforums->vars['display_max_posts'];
$page_no = $i + 1;
@@ -549,10 +709,23 @@ class UserCP {
}
else
{
// no results
$this->output .= $this->html->subs_none();
}
// Build date box
$date_box = "<option value='1'>".$ibforums->lang['subs_today']."</option>\n";
foreach( array( 1,7,14,21,30,60,90,365 ) as $day )
{
$selected = $day == $date_cut ? ' selected' : '';
$date_box .= "<option value='$day'$selected>".sprintf( $ibforums->lang['subs_day'], $day )."</option>\n";
}
$date_box .= "<option value='1000'>".$ibforums->lang['subs_all']."</option>\n";
$this->output .= $this->html->subs_end();
$this->output .= $this->html->subs_end($auto_explain, $date_box);
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array( "<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" );
@@ -701,6 +874,64 @@ class UserCP {
$dst_check = '';
}
//---------------------
if ($ibforums->vars['postpage_contents'] == "")
{
$ibforums->vars['postpage_contents'] = '5,10,15,20,25,30,35,40';
}
if ($ibforums->vars['topicpage_contents'] == "")
{
$ibforums->vars['topicpage_contents'] = '5,10,15,20,25,30,35,40';
}
list($post_page, $topic_page) = explode( "&", $ibforums->member['view_prefs'] );
if ($post_page == "")
{
$post_page = -1;
}
if ($topic_page == "")
{
$topic_page = -1;
}
$pp_a = array();
$tp_a = array();
$post_select = "";
$topic_select = "";
$pp_a[] = array( '-1', $ibforums->lang['pp_use_default'] );
$tp_a[] = array( '-1', $ibforums->lang['pp_use_default'] );
foreach( explode( ',', $ibforums->vars['postpage_contents'] ) as $n )
{
$n = intval(trim($n));
$pp_a[] = array( $n, $n );
}
foreach( explode( ',', $ibforums->vars['topicpage_contents'] ) as $n )
{
$n = intval(trim($n));
$tp_a[] = array( $n, $n );
}
//---------------------
foreach( $pp_a as $id => $data )
{
$post_select .= ($data[0] == $post_page) ? "<option value='{$data[0]}' selected>{$data[1]}\n" : "<option value='{$data[0]}'>{$data[1]}\n";
}
foreach( $tp_a as $id => $data )
{
$topic_select .= ($data[0] == $topic_page) ? "<option value='{$data[0]}' selected>{$data[1]}\n" : "<option value='{$data[0]}'>{$data[1]}\n";
}
//---------------------
$this->output .= $this->html->settings_header($this->member, $time_select, $time, $dst_check);
$hide_sess = $std->my_getcookie('hide_sess');
@@ -734,6 +965,8 @@ class UserCP {
'AVA' => $view_ava."</select>",
'POP' => $view_pop."</select>",
'SESS' => $html_sess."</select>",
'TPS' => $topic_select,
'PPS' => $post_select
) );
$this->page_title = $ibforums->lang['t_welcome'];
@@ -763,7 +996,7 @@ class UserCP {
$info = array();
foreach ( array(hide_email, allow_admin_mails, email_full, email_pm) as $k )
foreach ( array(hide_email, allow_admin_mails, email_full, email_pm, auto_track) as $k )
{
if (!empty($this->member[ $k ]))
{
@@ -991,6 +1224,80 @@ class UserCP {
$year .= $i == $this->member['bday_year'] ? "selected>$i</option>" : ">$i</option>";
}
//-----------------------------------------------
// Custom profile fields stuff
//-----------------------------------------------
$required_output = "";
$optional_output = "";
$field_data = array();
$DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'");
while ( $content = $DB->fetch_row() )
{
foreach($content as $k => $v)
{
if ( preg_match( "/^field_(\d+)$/", $k, $match) )
{
$field_data[ $match[1] ] = $v;
//break;
}
}
}
$DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 ORDER BY forder");
while( $row = $DB->fetch_row() )
{
$form_element = "";
if ( $row['freq'] == 1 )
{
$ftype = 'required_output';
}
else
{
$ftype = 'optional_output';
}
if ( $row['ftype'] == 'drop' )
{
$carray = explode( '|', trim($row['fcontent']) );
$d_content = "";
foreach( $carray as $entry )
{
$value = explode( '=', $entry );
$ov = trim($value[0]);
$td = trim($value[1]);
if ($ov !="" and $td !="")
{
$d_content .= ($field_data[$row['fid']] == $ov) ? "<option value='$ov' selected>$td</option>\n"
: "<option value='$ov'>$td</option>\n";
}
}
if ($d_content != "")
{
$form_element = $this->html->field_dropdown( 'field_'.$row['fid'], $d_content );
}
}
else if ( $row['ftype'] == 'area' )
{
$form_element = $this->html->field_textarea( 'field_'.$row['fid'], $field_data[$row['fid']] );
}
else
{
$form_element = $this->html->field_textinput( 'field_'.$row['fid'], $field_data[$row['fid']] );
}
${$ftype} .= $this->html->field_entry( $row['ftitle'], $row['fdesc'], $form_element );
}
//-----------------------------------------------
// Format the interest / location boxes
//-----------------------------------------------
@@ -998,20 +1305,6 @@ class UserCP {
$this->member['location'] = $this->parser->unconvert( $this->member['location'] );
$this->member['interests'] = $this->parser->unconvert( $this->member['interests'] );
//-----------------------------------------------
// Format the siggie (no, not ciggie - smoking is
// bad boys and girls)
//-----------------------------------------------
if ($ibforums->vars['sig_allow_html'])
{
$this->member['signature'] = $std->text_tidy($this->member['signature']);
}
else
{
$this->member['signature'] = $this->parser->unconvert($this->member['signature']);
}
//-----------------------------------------------
// Suck up the HTML and swop some tags if need be
//-----------------------------------------------
@@ -1028,6 +1321,20 @@ class UserCP {
$this->output = preg_replace( "/<!--\{BIRTHDAY\}-->/", $t_html, $this->output );
//-----------------------------------------------
// Add in the custom fields if we need to.
//-----------------------------------------------
if ($required_output != "")
{
$this->output = str_replace( "<!--{REQUIRED.FIELDS}-->", $this->html->required_title()."\n".$required_output, $this->output );
}
if ($optional_output != "")
{
$this->output = str_replace( "<!--{OPTIONAL.FIELDS}-->", "\n".$optional_output, $this->output );
}
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array( "<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" );
@@ -1087,16 +1394,16 @@ class UserCP {
$info['space_free'] = "Unlimited";
$info['total_messages'] = $total['msg_total'];
if ($ibforums->vars['max_messages'] > 0)
if ($ibforums->member['g_max_messages'] > 0)
{
if ($total['msg_total'] >= $ibforums->vars['max_messages'])
if ($total['msg_total'] >= $ibforums->member['g_max_messages'])
{
$info['full_messenger'] = "<span id='highlight'>".$ibforums->lang['folders_full']."</span>";
$info['full_messenger'] = "<span class='highlight'>".$ibforums->lang['folders_full']."</span>";
}
$info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", ( ($total['msg_total'] / $ibforums->vars['max_messages']) * 100) ) : 0;
$info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", ( ($total['msg_total'] / $ibforums->member['g_max_messages']) * 100) ) : 0;
$info['full_percent'] = "(". $info['full_percent'] .'% '. $ibforums->lang['total_capacity'] . ")";
$info['space_free'] = $ibforums->vars['max_messages'] - $total['msg_total'];
$info['space_free'] = $ibforums->member['g_max_messages'] - $total['msg_total'];
}