Example #1
0
function UpdateINI()
{
    global $db, $tablepre;
    $time = format_time(times());
    $ini = "; 字段信息配置文件\r\n; Created On {$time}\r\n\r\n";
    foreach (array(1 => 'USE', 2 => 'FEE', 3 => 'OUT') as $k => $v) {
        $ini .= "[{$v}]\r\n";
        $result = $db->getAll("SELECT * FROM `{$tablepre}cardini` WHERE pid='{$k}' AND disabled=0");
        foreach ($result as $r) {
            $ini .= $r['name'] . " = " . "\"" . $r['value'] . "\"\r\n";
        }
        $ini .= "\r\n";
    }
    @file_put_contents(ROOT_PATH . "data/detail.ini", $ini);
}
Example #2
0
	// Check for recent beackups
	$dir = "./admin/backup/";
	$handle = opendir($dir);
	$highest = 0;
	while ($file = readdir($handle)) {
		if ($file != "." && $file != ".." && !is_dir($dir.$file)) {
			$nfo = pathinfo($dir.$file);
			if ($nfo['extension'] == 'zip' || $nfo['extension'] == 'sql') {
				$date = str_replace('.zip', '', $nfo['basename']);
				$date = str_replace('.sql', '', $date);
				$valid = preg_match('/(\d{1,2})_(\d{1,2})_(\d{2,4})-(\d{1,2})_(\d{1,2})_(\d{1,2})/', $date, $mktime);
				if ($valid == 0) {
					$diff = times(filemtime($dir.$file));
				}
				else {
					$diff = times(gmmktime($mktime[4], $mktime[5], $mktime[6], $mktime[2], $mktime[1], $mktime[3]));
				}
				if ($diff > $highest) {
					$highest = $diff;
				}
			}
		}
	}
	$days = 7;
	$besttime = time()-$days*24*60*60;
	if ($highest < $besttime) {
		$last = (time()-$highest)/(24*60*60);
		if ($highest == 0) {
			$x1 = $lang->phrase('admin_task_no_backup_found');
		}
		else {
function getAge($bday)
{
    $now = times();
    if (gmdate("Y", $now) == $bday[0] && gmdate("m", $now) == $bday[1] && gmdate("d", $now) == $bday[2]) {
        $result = 0;
    } else {
        $result = gmdate("Y", $now) - $bday[0];
        if ($bday[1] > gmdate("m", $now)) {
            $result--;
        } elseif ($bday[1] == gmdate("m", $now)) {
            if ($bday[2] > gmdate("d", $now)) {
                $result--;
            }
        }
    }
    return $result;
}
		  <td class="obox" colspan="4"><?php echo $lang->phrase('admin_member_moderate'); ?> &amp; <?php echo $lang->phrase('admin_member_unlock_members'); ?></td>
		</tr>
		<tr>
		  <td class="ubox" width="30%"><?php echo $lang->phrase('admin_member_username'); ?></td>
		  <td class="ubox" width="10%"><?php echo $lang->phrase('admin_member_mail'); ?></td>
		  <td class="ubox" width="15%"><?php echo $lang->phrase('admin_member_registered'); ?></td>
		  <td class="ubox" width="45%"><?php echo $lang->phrase('admin_member_status'); ?> (<input type="checkbox" onchange="check_all(this)" value="delete[]" /> <?php echo $lang->phrase('admin_member_all'); ?>`)</td>
		</tr>
	<?php
	while ($row = $gpc->prepare($db->fetch_object($result))) {
		$row->regdate = gmdate('d.m.Y', times($row->regdate));
		if ($row->lastvisit == 0) {
			$row->lastvisit = $lang->phrase('admin_member_never');
		}
		else {
			$row->lastvisit = gmdate('d.m.Y', times($row->lastvisit));
		}
		?>
		<tr>
		  <td class="mbox"><a title="<?php echo $lang->phrase('admin_member_edit'); ?>" href="admin.php?action=members&job=edit&id=<?php echo $row->id; ?>"><?php echo $row->name; ?></a></td>
		  <td class="mbox" align="center"><a href="mailto:<?php echo $row->mail; ?>"><?php echo $lang->phrase('admin_member_mail'); ?></a></td>
		  <td class="mbox"><?php echo $row->regdate; ?></td>
		  <td class="mbox"><ul>
		  <?php if ($row->confirm == '00' || $row->confirm == '01') { ?>
		  <li><strong><a href="admin.php?action=members&job=confirm&id=<?php echo $row->id; ?>"><?php echo $lang->phrase('admin_member_confirm_user'); ?></a></strong></li>
		  <?php } if ($row->confirm == '00' || $row->confirm == '10') { ?>
		  <li><?php echo $lang->phrase('admin_member_must_activate_via_mail'); ?> [<a href="admin.php?action=members&job=confirm2&id=<?php echo $row->id; ?>"><?php echo $lang->phrase('admin_member_activate_user_completely'); ?></a>]</li>
		  <?php } ?>
		  <li><?php echo $lang->phrase('admin_member_delete_user'); ?> <input type="checkbox" name="delete[]" value="<?php echo $row->id; ?>"></li>
		  </ul></td>
		</tr>
         ($code = $plugins->load('showtopic_attachments_prepared')) ? eval($code) : null;
         if ($is_img == true) {
             $imagesize = getimagesize($uppath);
             $inner['image_box'] .= $tpl->parse("showtopic/image_box");
         } else {
             $inner['upload_box'] .= $tpl->parse("showtopic/upload_box");
         }
     }
 }
 $anz = 0;
 if (!empty($row->edit)) {
     $edits = explode("\n", $row->edit);
     $anz = count($edits);
     $anz--;
     $lastdata = explode("\t", $edits[$anz - 1]);
     $date = gmdate($lang->phrase('dformat1'), times($lastdata[1]));
     BBProfile($bbcode);
     $why = iif(empty($lastdata[2]), $lang->phrase('post_editinfo_na'), $bbcode->wordwrap($lastdata[2]));
 }
 // Ratings
 $showrating = false;
 $row->rating = 50;
 $ratingcounter = 0;
 if ($config['postrating'] == 1) {
     if (!isset($ratings[$row->id])) {
         $ratings[$row->id] = array();
     }
     if ($my->vlogin && $my->id != $row->mid && !isset($ratings[$row->id][$my->id])) {
         $showrating = true;
     }
     $ratingcounter = count($ratings[$row->id]);
    if (isset($row['posts'])) {
        $row['posts'] = numbers($row['posts']);
    }
    if (isset($row['birthday'])) {
        $bday = explode('-', $row['birthday']);
        if ($row['birthday'] != null && $row['birthday'] != '0000-00-00') {
            $row['birthday'] = iif($bday[0] > 0, $lang->phrase('members_bday_full'), $lang->phrase('members_bday_short'));
        } else {
            $row['birthday'] = $lang->phrase('members_na');
        }
    }
    if (!empty($row['pic']) && !file_exists($row['pic'])) {
        $row['pic'] = '';
    }
    if (isset($row['lastvisit'])) {
        $row['lastvisit'] = iif($row['lastvisit'] > 0, gmdate($lang->phrase('dformat1'), times($row['lastvisit'])), $lang->phrase('members_na'));
    }
    if (isset($row['online'])) {
        $row['lang_online'] = $lang->phrase('profile_' . iif($row['online'] == 1, 'online', 'offline'));
    }
    ($code = $plugins->load('members_prepare_bit')) ? eval($code) : null;
    $inner['index_bit'] .= $tpl->parse("members/index_bit");
}
($code = $plugins->load('members_prepared')) ? eval($code) : null;
$letter = $lang->phrase('members_all');
$row = array('letter' => '');
$inner['index_letter'] = $tpl->parse("members/index_letter");
$result = $db->query("SELECT DISTINCT UPPER(LEFT(name,1)) AS letter FROM {$db->pre}user ORDER BY letter", __LINE__, __FILE__);
while ($row = mysql_fetch_assoc($result)) {
    $letter =& $row['letter'];
    $inner['index_letter'] .= $tpl->parse("members/index_letter");
 /**
  * Returns the proper RFC 822 formatted date.
  * @access public
  * @return string
  * @static
  * Modified for Viscacha
  */
 public static function RFCDate()
 {
     global $config;
     // Global forum timezone to number
     $tz = round($config['timezone'], 2);
     // Get the prefix for the timezone
     $tzs = $tz < 0 ? "-" : "+";
     // Get the absolute value of the timezone (without prefix)
     $tz = abs($tz);
     // Get the timestamp according to rfc 822
     $tz = floor($tz) * 100 + ($tz - floor($tz)) * 60;
     // Put everything together
     $result = sprintf("%s %s%04d", gmdate("D, j M Y H:i:s", times(false, $config['timezone'])), $tzs, $tz);
     return $result;
 }
Example #8
0
$prefix = '';
if ($info['prefix'] > 0) {
    if (isset($prefix_arr[$info['prefix']])) {
        $prefix = $prefix_arr[$info['prefix']]['value'];
        $prefix = $lang->phrase('showtopic_prefix_title');
    }
}
get_headboards($fc, $last);
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($prefix . $info['topic'], 'showtopic.php?id=' . $info['topic_id'] . SID2URL_x);
$breadcrumb->Add($lang->phrase('edit'));
echo $tpl->parse("header");
if ($info['status'] != 0) {
    error($lang->phrase('topic_closed'), 'showtopic.php?action=jumpto&id=' . $info['topic_id'] . '&topic_id=' . $info['id']);
}
$diff = times() - $info['date'];
if ($config['edit_edit_time'] == 0) {
    $edit_seconds = $diff;
} else {
    $edit_seconds = $config['edit_edit_time'] * 60;
}
$delete_seconds = $config['edit_delete_time'] * 60;
if ($my->mp[4] == 1 && ($info['topic_id'] > 0 || $info['posts'] == 0)) {
    $del_mod = TRUE;
} else {
    $del_mod = FALSE;
}
if ($delete_seconds >= $diff && ($info['topic_id'] > 0 || $info['posts'] == 0)) {
    $del_user = TRUE;
} else {
    $del_user = FALSE;
    unset($archive);
    if ($del > 0) {
        $filesystem->unlink($file);
    }
    $filesystem->rmdirr($tempdir);
    $delobj = $scache->load('smileys');
    $delobj->delete();
    ok('admin.php?action=bbcodes&job=smileys', $lang->phrase('admin_bbc_successfully_imported'));
} elseif ($job == 'smileys_export') {
    $smileys = $gpc->get('id', arr_int);
    if (count($smileys) > 0) {
        $sqlwhere = " WHERE id IN (" . implode(',', $smileys) . ") ";
    } else {
        $sqlwhere = "";
    }
    $file = 'smileys_' . gmdate('Ymd', times()) . '.zip';
    $tempdir = "temp/";
    $smilieconfig = $config['smileypath'] . '/smileys.ini';
    $result = $db->query('SELECT `id`, `search`, `replace`, `desc` FROM `' . $db->pre . 'smileys` ' . $sqlwhere);
    $files = array();
    $filedata = array();
    while ($row = $db->fetch_assoc($result)) {
        $filepath = str_replace('{folder}', $config['smileypath'], $row['replace']);
        $filedata[$row['id']] = array('search' => $row['search'], 'replace' => $row['replace'], 'desc' => $row['desc']);
        if (!preg_match('~http(s)?:\\/\\/~i', $filepath)) {
            $files[] = $filepath;
        }
    }
    $myini = new INI();
    $myini->write($smilieconfig, $filedata);
    $files[] = $smilieconfig;
Example #10
0
" /></td>
   <td class="mbox"><input type="radio" name="new" value="<?php 
        echo urldecode($path . '/' . $hfile);
        ?>
" /></td>
  </tr>
  <?php 
    }
    ?>
  <tr>
   <td class="mbox"><?php 
    echo $lang->phrase('admin_design_current_default');
    ?>
</td>
   <td class="mbox"><?php 
    echo gmdate('d.m.Y H:i', times(filemtime($defpath . '/' . $file)));
    ?>
</td>
   <td class="mbox">
   <?php 
    echo iif($revert, '<a class="button" href="admin.php?action=designs&job=templates_file_revert&id=' . $id . '&dir=' . rawurlencode(iif(!empty($sub), $sub . '/')) . '&file=' . rawurldecode($file) . '&default=1">' . $lang->phrase('admin_design_revert') . '</a>', '&nbsp;');
    ?>
</td>
   <td class="mbox"><a class="button" href="admin.php?action=designs&job=templates_file_edit&id=<?php 
    echo $design['template'];
    ?>
&dir=<?php 
    echo rawurlencode(iif(!empty($sub), $sub . '/'));
    ?>
&file=<?php 
    echo rawurldecode($file);
Example #11
0
   <td class="ubox" width="10%"><?php 
    echo $lang->phrase('admin_cms_doc_action');
    ?>
</td>
  </tr>
<?php 
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    while ($row = $db->fetch_assoc($result)) {
        if (is_id($row['author']) && isset($memberdata[$row['author']])) {
            $row['author'] = $memberdata[$row['author']];
        } else {
            $row['author'] = $lang->phrase('admin_cms_unknown');
        }
        if ($row['update'] > 0) {
            $row['update'] = gmdate('d.m.Y H:i', times($row['update']));
        } else {
            $row['update'] = $lang->phrase('admin_cms_unknown');
        }
        ?>
  <tr>
   <td class="mbox" width="5%"><input type="checkbox" name="delete[]" value="<?php 
        echo $row['id'];
        ?>
"></td>
   <td class="mbox" width="40%"><a href="admin.php?action=cms&job=doc_edit&id=<?php 
        echo $row['id'];
        ?>
"><?php 
        echo $row['title'];
        ?>
Example #12
0
                $useragent = $lang->phrase('admin_spider_not_specified');
            } else {
                $useragent = "<select style=\"width: 90%;\">";
                foreach ($useragents as $ua) {
                    $useragent .= "<option>" . htmlspecialchars($ua) . "</option>";
                }
                $useragent .= "</select> (" . count($useragents) . ")";
            }
            $last_visits = explode('|', $row['last_visit']);
            if (empty($last_visits[0])) {
                $last_visit = $lang->phrase('admin_spider_last_visit_never');
            } else {
                $last_visit = "<select>";
                $last_visits = array_reverse($last_visits);
                foreach ($last_visits as $visit) {
                    $last_visit .= "<option>" . gmdate("d.m.Y @ H:i:s", times($visit)) . "</option>";
                }
                $last_visit .= "</select>";
            }
            ?>
			<tr>
				<td class="mbox" width="25%"><?php 
            echo $row['name'];
            ?>
</td>
				<td class="mbox" width="20%" nowrap="nowrap"><?php 
            echo $useragent;
            ?>
</td>
				<td class="mbox" width="10%" align="center" nowrap="nowrap"><?php 
            echo $row['bot_visits'];
Example #13
0
} else {
    $_GET['order'] = 'ASC';
}
if ($_GET['sort'] == 'regdate' || $_GET['sort'] == 'location') {
    $sort = $_GET['sort'];
} else {
    $sort = 'name';
}
if (strlen($_GET['letter']) == 1) {
    $where = ' WHERE LEFT(name,1) = "' . $_GET['letter'] . '"';
} else {
    $where = '';
}
$start = $_GET['page'] * $config['mlistenzahl'];
$start = $start - $config['mlistenzahl'];
$result = $db->query('SELECT id,name,mail,hp,location,fullname,regdate FROM ' . $db->pre . 'user' . $where . ' ORDER BY ' . $sort . ' ' . $_GET['order'] . ' LIMIT ' . $start . ',' . $config['mlistenzahl'], __LINE__, __FILE__);
if ($db->num_rows() == 0) {
    error($lang->phrase('query_string_error'), 'members.php' . SID2URL_1);
}
$inner['index_bit'] = '';
while ($row = $gpc->prepare($db->fetch_object($result))) {
    $row->regdate = gmdate($lang->phrase('dformat2'), times($row->regdate));
    $inner['index_bit'] .= $tpl->parse("members/index_bit");
}
echo $tpl->parse("members/index");
$mymodules->load('members_bottom');
$slog->updatelogged();
$zeitmessung = t2();
echo $tpl->parse("footer");
$phpdoc->Out();
$db->close();
function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins;
    $found = false;
    $sub_cache = array();
    $sub_cache_last = array();
    $cat_cache = array();
    $mod_cache = array();
    $forum_cache = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("SELECT \n    \tc.id, c.name, c.desc, c.opt, c.optvalue, c.bid, c.topics, c.replys, c.cid, c.last_topic, c.invisible,  \n    \tt.topic as btopic, t.id as btopic_id, t.last as bdate, u.name AS uname, t.last_name AS bname\n    FROM {$db->pre}cat AS c\n        LEFT JOIN {$db->pre}topics AS t ON c.last_topic=t.id \n        LEFT JOIN {$db->pre}user AS u ON t.last_name=u.id \n    ORDER BY c.cid, c.c_order, c.id", __LINE__, __FILE__);
    if ($db->num_rows($result) == 0) {
        $errormsg = array('There are currently no boards to show. Pleas visit the <a href="admin.php' . SID2URL_1 . '">Admin Control Panel</a> and create some forums.');
        $errorurl = '';
        $tpl->globalvars(compact("errorurl", "errormsg"));
        echo $tpl->parse('main/error');
        return $found;
    }
    while ($row = $db->fetch_assoc($result)) {
        $gpc->prepare($row['name']);
        $gpc->prepare($row['btopic']);
        $gpc->prepare($row['uname']);
        $gpc->prepare($row['bname']);
        // Caching for Subforums
        if ($row['bid'] > 0) {
            $sub_cache[$row['bid']][] = $row;
            $sub_cache_last[$row['id']] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['cid']][] = $row;
        }
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $forums = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            $forum['mbdate'] = $forum['bdate'];
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replys'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replys'] = $substats[1];
                $bids = $substats[2];
            }
            $last = $forum['last_topic'];
            $last_date = $forum['bdate'];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($bids as $bidf) {
                    $sub = $sub_cache_last[$bidf];
                    if ($last_date < $sub['bdate']) {
                        $last = $sub['id'];
                        $last_date = $sub['bdate'];
                    }
                }
            }
            $forum['lname'] = is_id($forum['bname']) ? $forum['uname'] : $forum['bname'];
            if ($last != $forum['last_topic']) {
                $forum['id2'] = $last;
                $forum['last_topic'] = $sub_cache_last[$forum['id2']]['last_topic'];
                $forum['btopic_id'] = $sub_cache_last[$forum['id2']]['btopic_id'];
                $forum['btopic'] = $sub_cache_last[$forum['id2']]['btopic'];
                $forum['bdate'] = $sub_cache_last[$forum['id2']]['bdate'];
                if (!isset($sub_cache_last[$forum['id2']]['lname'])) {
                    $forum['lname'] = is_id($sub_cache_last[$forum['id2']]['bname']) ? $sub_cache_last[$forum['id2']]['uname'] : $sub_cache_last[$forum['id2']]['bname'];
                } else {
                    $forum['lname'] = $sub_cache_last[$forum['id2']]['lname'];
                }
            } else {
                $forum['id2'] = $forum['id'];
            }
            $id = array_search(trim($forum['lname']), $memberdata);
            if (is_id($id)) {
                $forum['lname'] = array($forum['lname'], $id);
            } else {
                $forum['lname'] = array($forum['lname'], 0);
            }
            if ($forum['btopic_id']) {
                $forum['tid'] = $forum['btopic_id'];
            } else {
                $forum['tid'] = $forum['last_topic'];
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] == 1) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['topics'] = '-';
                    $forum['replys'] = '-';
                    $forum['btopic'] = false;
                } else {
                    if (isset($my->mark['f'][$forum['id']]) && $my->mark['f'][$forum['id']] > $forum['bdate'] || $forum['bdate'] < $my->clv || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['new'] = true;
                    }
                    if ($forum['btopic']) {
                        if (strxlen($forum['btopic']) >= 40) {
                            $forum['btopic'] = substr($forum['btopic'], 0, 40);
                            $forum['btopic'] .= "...";
                        }
                        $forum['bdate'] = str_date($lang->phrase('dformat1'), times($forum['bdate']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replys'] = numbers($forum['replys']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] == 1) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                }
                            } else {
                                if (isset($my->mark['f'][$sub_cache[$forum['id']][$i]['id']]) && $my->mark['f'][$sub_cache[$forum['id']][$i]['id']] > $sub_cache[$forum['id']][$i]['bdate'] || $sub_cache[$forum['id']][$i]['bdate'] < $my->clv || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $forums[] = $forum;
            }
        }
        if (count($forums) > 0) {
            $tpl->globalvars(compact("cat", "forums"));
            ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
            echo $tpl->parse("categories");
        }
    }
    return $found;
}
Example #15
0
        	<span class="stext">
        		<a target="_blank" href="showtopic.php?id=<?php 
            echo $row->id;
            ?>
"><?php 
            echo iif($showprefix, '[' . $prefix . '] ') . $row->topic;
            ?>
</a><br />
        		<?php 
            echo $row->forumname;
            ?>
        	</span>
        </td>
        <td>
        	<?php 
            echo gmdate('d.m.Y H:i', times($row->date));
            ?>
<br />
        	<?php 
            echo iif($row->mid, "<a href='admin.php?action=members&amp;job=edit&amp;id=" . $row->mid . "'>" . $row->name . "</a>", $row->name);
            ?>
        </td>
        <td align="center"><textarea cols="30" rows="3" style="width: 99%;"><?php 
            echo $row->report;
            ?>
</textarea></td>
        </tr>
		<?php 
        }
        ?>
  <tr>
Example #16
0
     $prefix = $prefix_arr[$row->prefix]['value'];
     $showprefix = true;
 } else {
     $prefix = '';
 }
 if (is_id($row->name) && isset($memberdata[$row->name])) {
     $row->mid = $row->name;
     $row->name = $memberdata[$row->name];
 } else {
     $row->mid = FALSE;
 }
 if (is_id($row->last_name) && isset($memberdata[$row->last_name])) {
     $row->last_name = $memberdata[$row->last_name];
 }
 $rstart = str_date('d.m.Y H:i', times($row->date));
 $rlast = str_date('d.m.Y H:i', times($row->last));
 if ($row->status == '2') {
     $pref .= $lang->phrase('forum_moved');
 } else {
     if (empty($row->mark) && !empty($info['auto_status'])) {
         $row->mark = $info['auto_status'];
     }
     if ($row->mark == 'n') {
         $pref .= 'News: ';
     } elseif ($row->mark == 'a') {
         $pref .= 'Artcle: ';
     } elseif ($row->mark == 'b') {
         $pref .= 'Bad: ';
     } elseif ($row->mark == 'g') {
         $pref .= 'Good: ';
     }
Example #17
0
        $row['name'] = $row['gname'];
        $row['mid'] = 0;
        $row['groups'] = GROUP_GUEST;
    }
    $row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
    $edit = array();
    if (!empty($row['edit'])) {
        $edits = explode("\n", $row['edit']);
        $i = 0;
        foreach ($edits as $e) {
            $e = trim($e);
            if (empty($e)) {
                continue;
            }
            $data = explode("\t", $e);
            $edit[$i] = array('date' => str_date($lang->phrase('dformat1'), times($data[1])), 'reason' => @iif(empty($data[2]), $lang->phrase('post_editinfo_na'), $data[2]), 'name' => $data[0], 'ip' => @iif(isset($data[3]), $data[3]));
            ($code = $plugins->load('popup_edithistory_entry_prepared')) ? eval($code) : null;
            $i++;
        }
    }
    ($code = $plugins->load('popup_edithistory_prepared')) ? eval($code) : null;
    echo $tpl->parse("popup/edithistory");
    ($code = $plugins->load('popup_edithistory_end')) ? eval($code) : null;
} elseif ($_GET['action'] == "postrating") {
    $rtg = $gpc->get('rating', int);
    ($code = $plugins->load('popup_postrating_start')) ? eval($code) : null;
    if ($my->vlogin) {
        $result = $db->query("SELECT * FROM {$db->pre}replies WHERE id = '{$_GET['id']}'", __LINE__, __FILE__);
        $post = $db->fetch_assoc($result);
        if ($post['name'] == $my->id) {
            $error = $lang->phrase('postrating_you_posted');
 function setlang($l1, $l2)
 {
     global $my;
     if (!$my->vlogin) {
         $my->name = $l1;
     }
     if (date('I', times()) == 1) {
         $my->timezonestr .= $l2;
     }
 }
/**
 * Bans a user.
 *
 * After calling the function exit() is called and script ends.
 * Connection to database is closed. Template 'banned' will be shown.
 * This is not shown in the AdminCP!
 */
function banish($reason = null, $until = null) {
	global $config, $db, $phpdoc, $lang, $plugins, $tpl, $my, $breadcrumb;

	if (substr($reason, 0, 6) == 'lang->') {
		$key = substr($reason, 6);
		$reason = $lang->phrase($key);
	}
	if ($reason == null) {
		$reason = $lang->phrase('banned_no_reason');
	}
	else {
		$reason = htmlspecialchars($reason);
	}
	if ($until > 0) {
		$until = gmdate($lang->phrase('dformat1'), times($until));
	}
	else {
		$until = $lang->phrase('banned_left_never');
	}

	($code = $plugins->load('permissions_banish')) ? eval($code) : null;

	$tpl->globalvars(compact('reason', 'until'));
	echo $tpl->parse("banned");

	$phpdoc->Out();
	$db->close();
	exit();
}
 function showContent($print = true)
 {
     global $lang;
     $dir_list = $file_list = $subdir_size_list = array();
     $total_dir_size = 0;
     if (($dir_handle = opendir($this->path)) === false) {
         error('admin.php?action=explorer', $lang->phrase('admin_explorer_could_not_open_dir') . realpath($this->path));
     }
     while (($file = @readdir($dir_handle)) !== false) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         if (is_dir($this->path . $file)) {
             $dir_list[] = $file;
             if ($this->show_subfolders_size) {
                 $stack = array($this->path . $file . '/');
                 $size = 0;
                 while (count($stack) > 0) {
                     $subdir = array_shift($stack);
                     $subdir_handle = @opendir($subdir);
                     while (($subdir_file = @readdir($subdir_handle)) !== false) {
                         if ($subdir_file == '.' || $subdir_file == '..') {
                             continue;
                         }
                         if ($this->show_subfolders_size) {
                             if (is_dir($subdir . $subdir_file)) {
                                 array_push($stack, $subdir . $subdir_file . '/');
                             }
                         }
                         $size += @filesize($subdir . $subdir_file);
                     }
                     @closedir($subdir_handle);
                 }
                 $subdir_size_list[$file] = $size;
                 $total_dir_size += $size;
             }
         } else {
             $file_list[] = $file;
             $total_dir_size += @filesize($this->path . $file);
         }
     }
     @closedir($dir_handle);
     natcasesort($dir_list);
     natcasesort($file_list);
     $total_files = count($dir_list) + count($file_list);
     $total_size = $this->formatSize($total_dir_size);
     $print_spacer = count($file_list) > 0 && count($dir_list) > 0 ? true : false;
     $page_link = $this->realPath(dirname($this->script_file) . '/' . $this->path);
     $rp = realpath($this->path);
     $root = extract_dir($this->root);
     $rp = str_replace($root, '', $rp);
     $heading_path = $this->realPath($rp);
     $heading_path_parts = explode("/", $heading_path);
     $levels = count($heading_path_parts) - 2;
     for ($heading_path = ""; $levels > -1; $levels--) {
         for ($i = 0, $path = ""; $i < $levels; $i++) {
             $path .= "../";
         }
         $link = '&amp;path=' . urlencode($this->realPath($this->path . $path));
         $heading_path .= '<a href="' . $this->script_file . $link . '">' . array_shift($heading_path_parts) . '</a>' . DIRECTORY_SEPARATOR;
     }
     $newdir = $this->script_file . '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path));
     $newdir_html = '<span style="float: right;"><a class="button" href="' . $newdir . '&job=newdir">' . $lang->phrase('admin_explorer_create_new_directory') . '</a></span>';
     $html = '	   <table cellpadding="4" cellspacing="0" class="border">';
     $html .= "\n" . '		 <tr>';
     $html .= "\n" . '		   <td class="obox"><span style="float: right;"><a class="button" href="admin.php?action=explorer&amp;job=all_chmod">' . $lang->phrase('admin_explorer_check_chmod') . '</a></span>' . iif(count($dir_list) == 0, $newdir_html) . $lang->phrase('admin_explorer_filemanager') . '</td>';
     $html .= "\n" . '		 </tr>';
     $html .= "\n" . '		 <tr>';
     $html .= "\n" . '		   <td class="ubox">' . $lang->phrase('admin_explorer_directory_x') . extract_dir($this->root) . $heading_path . '</td>';
     $html .= "\n" . '		 </tr>';
     $html .= "\n" . '	   </table><br />';
     $html .= "\n" . '	   <table cellpadding="4" cellspacing="0" class="border">';
     if (count($dir_list) > 0) {
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="obox" colspan="5">' . $newdir_html . $lang->phrase('admin_explorer_directories') . '</td>';
         $html .= "\n" . '		 </tr>';
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="ubox" width="30%">' . $lang->phrase('admin_explorer_directory') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="9%">' . $lang->phrase('admin_explorer_size') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="20%">' . $lang->phrase('admin_explorer_created_on') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="8%">' . $lang->phrase('admin_explorer_chmod') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="33%">' . $lang->phrase('admin_explorer_action') . '</td>';
         $html .= "\n" . '		 </tr>';
     }
     while (($dir = array_shift($dir_list)) !== NULL) {
         $path_url = '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path) . $dir . '/');
         $link = $this->script_file . $path_url;
         $size = $this->show_subfolders_size ? $this->formatSize($subdir_size_list[$dir]) : "&nbsp;";
         $chmod = get_chmod($this->path . $dir);
         $icon = $this->icons('directory');
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 <a href="' . $link . '" target="Main">' . $icon . $dir . '</a>';
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox" align="right">';
         $html .= "\n" . '			 ' . $size;
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 ' . gmdate("d.m.y, H:i", times(filectime($this->path . $dir)));
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox" align="right">';
         $html .= "\n" . '			 ' . $chmod;
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			<a class="button" href="' . $link . '&job=chmod&type=dir">' . $lang->phrase('admin_explorer_file_chmod') . '</a> <a class="button" href="' . $link . '&job=rename&type=dir">' . $lang->phrase('admin_explorer_file_rename') . '</a> <a class="button" href="' . $link . '&job=delete&type=dir">' . $lang->phrase('admin_explorer_file_delete') . '</a>';
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		 </tr>';
     }
     if ($print_spacer) {
         $html .= "\n" . '   </table><br />';
         $html .= "\n" . '   <table cellpadding="4" cellspacing="0" class="border">';
     }
     if (count($file_list) > 0) {
         $lang->assign('total_files', $total_files);
         $lang->assign('total_size', $total_size);
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="obox" colspan="6">' . $lang->phrase('admin_explorer_files') . '</td>';
         $html .= "\n" . '		 </tr>';
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="ubox" width="30%">' . $lang->phrase('admin_explorer_toal_files') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="7%">' . $lang->phrase('admin_explorer_size') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="12%">' . $lang->phrase('admin_explorer_last_modified') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="12%">' . $lang->phrase('admin_explorer_created_on') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="7%">' . $lang->phrase('admin_explorer_chmod') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="33%">' . $lang->phrase('admin_explorer_action') . '</td>';
         $html .= "\n" . '		 </tr>';
     }
     while (($file = array_shift($file_list)) !== NULL) {
         $extension = preg_replace("/^.*?\\.(\\w{1,8})\$/", "\\1", $file);
         $path_url = '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path) . $file);
         $link = $this->script_file . $path_url;
         $icon = $this->icons($extension);
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 <a href="' . str_replace('/\\', '/', $this->path) . $file . '">' . $icon . $file . '</a>';
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox" align="right">';
         $html .= "\n" . '			 ' . $this->formatSize(filesize($this->path . $file));
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 ' . gmdate("d.m.y, H:i", times(filemtime($this->path . $file)));
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 ' . gmdate("d.m.y, H:i", times(filectime($this->path . $file)));
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox" align="right">';
         $html .= "\n" . '			 ' . get_chmod($this->path . $file);
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 <a class="button" href="' . $link . '&job=chmod">' . $lang->phrase('admin_explorer_file_chmod') . '</a> <a class="button" href="' . $link . '&job=rename">' . $lang->phrase('admin_explorer_file_rename') . '</a> <a class="button" href="' . $link . '&job=delete">' . $lang->phrase('admin_explorer_file_delete') . '</a>';
         $html .= iif(in_array($extension, $this->extract), ' <a class="button" href="' . $link . '&job=extract">' . $lang->phrase('admin_explorer_file_extract') . '</a>') . iif(in_array($extension, $this->plain), ' <a class="button" href="' . $link . '&job=edit">' . $lang->phrase('admin_explorer_file_edit') . '</a>');
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		 </tr>';
     }
     $html .= "\n" . '	   </table>';
     if ($print) {
         echo $html;
     } else {
         return $html;
     }
 }
Example #21
0
 $wraps_obj = $scache->load('wraps');
 $wrap_cache = $wraps_obj->get();
 // Mitglieder
 $memberdata_obj = $scache->load('memberdata');
 $memberdata = $memberdata_obj->get();
 // Cache
 $cache = array();
 $lang->group('wwo');
 ($code = $plugins->load('misc_wwo_start')) ? eval($code) : null;
 $result = $db->query("\n\tSELECT ip, mid, active, wiw_script, wiw_action, wiw_id, user_agent, is_bot\n\tFROM {$db->pre}session\n\tORDER BY active DESC\n\t", __LINE__, __FILE__);
 while ($row = $db->fetch_object($result)) {
     $row->user_agent = strip_tags($row->user_agent);
     $row->wiw_action = $gpc->prepare($row->wiw_action);
     $wwo['i']++;
     $bot = 0;
     $time = gmdate($lang->phrase('dformat3'), times($row->active));
     if (isset($memberdata[$row->mid])) {
         $row->name = $memberdata[$row->mid];
     } else {
         $row->name = $lang->phrase('fallback_no_username');
     }
     switch (strtolower($row->wiw_script)) {
         case 'managetopic':
         case 'managemembers':
         case 'manageforum':
         case 'forum':
         case 'edit':
         case 'team':
         case 'portal':
         case 'register':
         case 'editprofile':
function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins, $slog;
    $found = false;
    $sub_cache = $forum_cache = $last_cache = $forums = $cat = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    $prefix_obj = $scache->load('prefix');
    $prefix = $prefix_obj->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("\n\tSELECT\n\t\tf.id, f.name, f.description, f.opt, f.optvalue, f.parent, f.topics, f.replies, f.last_topic, f.invisible,\n\t\tt.topic as l_topic, t.prefix AS l_prefix, t.id as l_tid, t.last as l_date, u.name AS l_uname, t.last_name AS l_name, f.id AS l_bid\n\tFROM {$db->pre}forums AS f\n\t\tLEFT JOIN {$db->pre}topics AS t ON f.last_topic=t.id\n\t\tLEFT JOIN {$db->pre}user AS u ON t.last_name=u.id\n\tORDER BY f.parent, f.position\n\t");
    $keys = array('l_prefix' => null, 'l_topic_full' => null, 'l_topic' => null, 'l_tid' => null, 'l_date' => null, 'l_uname' => null, 'l_name' => null, 'l_bid' => null);
    while ($row = $db->fetch_assoc($result)) {
        $row['name'] = $gpc->prepare($row['name']);
        $row['l_uname'] = $gpc->prepare($row['l_uname']);
        $row['l_name'] = $gpc->prepare($row['l_name']);
        $row['bid'] = $cat_cache[$row['parent']]['parent'];
        // Caching for Subforums
        if (!empty($row['bid'])) {
            $sub_cache[$row['bid']][] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['parent']][] = $row;
        }
        $last_cache[$row['id']] = $row;
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    $cats = array();
    $hidden = 0;
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $cat['forums'] = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replies'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replies'] = $substats[1];
            }
            // Letzter Beitrag
            $last = $last_cache[$forum['id']];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($substats[2] as $last_bid) {
                    $sub = $last_cache[$last_bid];
                    if ($last['l_date'] < $sub['l_date'] && check_forumperm($sub)) {
                        $last = $sub;
                    }
                }
            }
            $forum = array_merge($forum, array_intersect_key($last, $keys));
            if (is_id($forum['l_name']) && isset($memberdata[$forum['l_name']])) {
                $forum['l_name'] = array($forum['l_uname'], $forum['l_name']);
            } else {
                $forum['l_name'] = array($forum['l_name'], 0);
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] != 0) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['state'] = BOARD_STATE_LOCKED;
                    $forum['topics'] = '-';
                    $forum['replies'] = '-';
                    $forum['l_topic'] = false;
                    $forum['l_topic_full'] = '';
                } else {
                    if ($slog->isForumRead($forum['id'], $forum['l_date']) || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                        $forum['state'] = BOARD_STATE_OLD;
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['state'] = BOARD_STATE_NEW;
                        $forum['new'] = true;
                    }
                    if (!empty($forum['l_topic'])) {
                        if (isset($prefix[$forum['id']][$forum['l_prefix']]) && $forum['l_prefix'] > 0) {
                            $lang->assign('prefix', $prefix[$forum['id']][$forum['l_prefix']]['value']);
                            $forum['l_prefix'] = $lang->phrase('showtopic_prefix_title');
                        } else {
                            $forum['l_prefix'] = '';
                        }
                        if (strxlen($forum['l_topic']) > $config['lasttopic_chars']) {
                            $forum['l_topic_full'] = $forum['l_prefix'] . $forum['l_topic'];
                            $forum['l_topic'] = subxstr($forum['l_topic'], 0, $config['lasttopic_chars']);
                            $forum['l_topic'] .= "...";
                        } else {
                            $forum['l_topic_full'] = '';
                        }
                        $forum['l_date'] = str_date($lang->phrase('dformat1'), times($forum['l_date']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replies'] = numbers($forum['replies']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] != 0) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_LOCKED;
                                }
                            } else {
                                if ($slog->isForumRead($sub_cache[$forum['id']][$i]['id'], $sub_cache[$forum['id']][$i]['l_date']) || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_OLD;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_NEW;
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                            $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_WWW;
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $cat['forums'][] = $forum;
            } elseif ($forum['invisible'] != 2) {
                $hidden++;
            }
        }
        if (count($cat['forums']) > 0) {
            $cats[] = $cat;
        }
    }
    ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
    $error_state = count($cats) == 0 && $board == 0;
    if (count($cats) > 0 || $error_state) {
        $tpl->globalvars(compact("cats", "board", "hidden", "error_state"));
        echo $tpl->parse("categories");
    }
    // Else: This is a forum without sub forums (that should be displayed)
    return $found;
}
Example #23
0
 echo head();
 $id = $gpc->get('id', int);
 $bid = $gpc->get('bid', int);
 $temp1 = $gpc->get('name', str);
 $month = $gpc->get('month', int);
 $day = $gpc->get('day', int);
 $weekday = $gpc->get('weekday', int);
 if (!is_id($id)) {
     error('admin.php?action=forums&job=manage', 'Forum or Category was not found on account of an invalid ID.');
 }
 $uid = $db->fetch_num($db->query('SELECT id FROM ' . $db->pre . 'user WHERE name = "' . $temp1 . '" LIMIT 1', __LINE__, __FILE__));
 if ($uid[0] < 1) {
     error('admin.php?action=forums&job=mods_add' . iif($bid > 0, '&id=' . $id), 'Member not found!');
 }
 if ($month > 0 && $day > 0 && $weekday > 0) {
     $timestamp = "'" . times(gmmktime(0, 0, 0, $month, $day, $weekday, -1)) . "'";
 } else {
     $timestamp = 'NULL';
 }
 $news = $gpc->get('news', int);
 $article = $gpc->get('article', int);
 $rating = $gpc->get('rating', int);
 $move = $gpc->get('move', int);
 $delete = $gpc->get('delete', int);
 $db->query("\n\tINSERT INTO {$db->pre}moderators (mid, bid, s_rating, s_news, s_article, p_delete, p_mc, time) \n\tVALUES ('{$uid[0]}', '{$id}', '{$rating}', '{$news}', '{$article}', '{$delete}', '{$move}', {$timestamp})\n\t", __LINE__, __FILE__);
 if ($db->affected_rows() == 1) {
     $delobj = $scache->load('index_moderators');
     $delobj->delete();
     ok('admin.php?action=forums&job=mods' . iif($bid > 0, '&id=' . $id), 'Moderator successfully added!');
 } else {
     error('admin.php?action=forums&job=mods' . iif($bid > 0, '&id=' . $id), 'Could not insert data into database.');
         $is_img = $imginfo == 'gif' || $imginfo == 'jpg' || $imginfo == 'jpeg' || $imginfo == 'jpe' || $imginfo == 'png' ? true : false;
         ($code = $plugins->load('showtopic_attachments_prepared')) ? eval($code) : null;
         if ($is_img == true) {
             $imagesize = getimagesize($uppath);
             $inner['image_box'] .= $tpl->parse("showtopic/image_box");
         } else {
             $inner['upload_box'] .= $tpl->parse("showtopic/upload_box");
         }
     }
 }
 $edit = array();
 if (!empty($row->edit)) {
     preg_match_all('~^([^\\t]+)\\t(\\d+)\\t([^\\t]*)\\t([\\d\\.]+)$~m', $row->edit, $edits, PREG_SET_ORDER);
     BBProfile($bbcode);
     foreach ($edits as $e) {
         $edit[] = array($e[1], gmdate($lang->phrase('dformat1'), times($e[2])), empty($e[3]) ? $lang->phrase('post_editinfo_na') : $bbcode->wordwrap($e[3]), empty($e[4]) ? '-' : $e[4]);
     }
     $anz = count($edit);
     if ($anz == 0) {
         $row->edit = null;
     }
     $lastdata = end($edit);
     if ($lastdata != false) {
         list(, $date, $why, ) = $lastdata;
     }
 }
 // Ratings
 $showrating = false;
 $row->rating = 50;
 $ratingcounter = 0;
 if ($config['postrating'] == 1) {
            }
        }
        ?>
	   </td>
	  </tr>
	  <?php 
    }
    if (!empty($row['last_updated'])) {
        ?>
	  <tr>
	   <td class="mbox" width="30%"><?php 
        echo $lang->phrase('admin_packages_browser_last_update');
        ?>
</td>
	   <td class="mbox" width="70%"><?php 
        echo gmdate('d.m.Y H:i', times($row['last_updated']));
        ?>
</td>
	  </tr>
	  <?php 
    }
    if (!empty($row['copyright'])) {
        ?>
	  <tr>
	   <td class="mbox" width="30%"><?php 
        echo $lang->phrase('admin_packages_info_copyright');
        ?>
</td>
	   <td class="mbox" width="70%"><?php 
        echo str_ireplace('(C)', '&copy;', $row['copyright']);
        ?>
        $mydesign = $design[$config['templatedir']]['name'];
        $my->template = $config['templatedir'];
    }
    $loadlanguage_obj = $scache->load('loadlanguage');
    $language = $loadlanguage_obj->get();
    if (!empty($my->settings['q_lng']) && isset($language[$my->settings['q_lng']])) {
        $mylanguage = $language[$my->settings['q_lng']]['language'];
        $my->language = $my->settings['q_lng'];
    } elseif (isset($language[$update['language']])) {
        $mylanguage = $language[$update['language']]['language'];
        $my->language = $update['language'];
    } else {
        $mylanguage = $language[$config['langdir']]['language'];
        $my->language = $config['langdir'];
    }
    $time = gmdate($lang->phrase('dformat3'), times());
    $customfields = editprofile_customfields(2, $my->id);
    ($code = $plugins->load('editprofile_settings_prepared')) ? eval($code) : null;
    echo $tpl->parse("editprofile/settings");
} elseif ($_GET['action'] == "settings2") {
    $loaddesign_obj = $scache->load('loaddesign');
    $cache = $loaddesign_obj->get();
    $loadlanguage_obj = $scache->load('loadlanguage');
    $cache2 = $loadlanguage_obj->get();
    $error = array();
    if (intval($_POST['location']) < -12 && intval($_POST['location']) > 12) {
        $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('timezone');
    }
    if ($_POST['opt_0'] < 0 && $_POST['opt_0'] > 2) {
        $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_editor');
    }
Example #27
0
    echo foot(true);
} elseif ($job == 'doc') {
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $language_obj = $scache->load('loadlanguage');
    $language = $language_obj->get();
    $result = $db->query("\n\t\tSELECT d.id, d.author, d.update, d.icomment, c.lid, c.title, c.active\n\t\tFROM {$db->pre}documents AS d\n\t\t\tLEFT JOIN {$db->pre}documents_content AS c ON d.id = c.did\n\t\tORDER BY c.title\n\t");
    $data = array();
    while ($row = $db->fetch_assoc($result)) {
        if (is_id($row['author']) && isset($memberdata[$row['author']])) {
            $row['author'] = $memberdata[$row['author']];
        } else {
            $row['author'] = $lang->phrase('admin_cms_unknown');
        }
        if ($row['update'] > 0) {
            $row['update'] = gmdate('d.m.Y', times($row['update'])) . '<br />' . gmdate('H:i', times($row['update']));
        } else {
            $row['update'] = $lang->phrase('admin_cms_unknown');
        }
        if (strlen($row['icomment']) > 100) {
            $row['icomment'] = substr($row['icomment'], 0, 100) . '...';
        }
        $newRow = array('title' => $row['title'], 'active' => $row['active']);
        if (!isset($data[$row['id']])) {
            $row['languages'] = array($row['lid'] => $newRow);
            $data[$row['id']] = $row;
        } else {
            if (!in_array($row['lid'], $data[$row['id']]['languages'])) {
                $data[$row['id']]['languages'][$row['lid']] = $newRow;
            }
        }
 /**
  * Returns the proper RFC 822 formatted date.
  * @access private
  * @return string
  * @modified for Viscacha
  */
 function RFCDate()
 {
     $tz = (time() - times()) * -1;
     $tzs = $tz < 0 ? "-" : "+";
     $tz = abs($tz);
     $tz = $tz / 3600 * 100 + $tz % 3600 / 60;
     $result = sprintf("%s %s%04d", gmdate("D, j M Y H:i:s", times()), $tzs, $tz);
     return $result;
 }
Example #29
0
<?php

global $memberdata;
global $gpc;
$result = $db->query("\nSELECT t.id, t.board, t.topic, t.last AS date, t.last_name AS name\nFROM {$db->pre}topics AS t LEFT JOIN {$db->pre}cat AS c ON t.board = c.id \nWHERE c.opt != 'pw' AND t.status != '2' " . $slog->sqlinboards('t.board') . "\nORDER BY t.last DESC \nLIMIT 0," . $ini['params']['num'], __LINE__, __FILE__);
if ($db->num_rows($result) > 0) {
    if (!isset($memberdata) || !is_array($memberdata)) {
        $memberdata = cache_memberdata();
    }
    $lastbox = array();
    while ($row = $gpc->prepare($db->fetch_assoc($result))) {
        if (is_id($row['name']) && isset($memberdata[$row['name']])) {
            $row['name'] = $memberdata[$row['name']];
        }
        $row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
        if (strxlen($row['topic']) >= 75) {
            $row['topic'] = substr($row['topic'], 0, 75);
            $row['topic'] .= $lang->phrase('dot_more');
        }
        $lastbox[] = $row;
    }
    $tpl->globalvars(compact("lastbox"));
    $lang->assign('num', $ini['params']['num']);
    echo $tpl->parse($dir . "last");
}
Example #30
0
 if ($row->prefix > 0 && isset($prefix_arr[$row->board][$row->prefix])) {
     $showprefix = true;
     $prefix = $prefix_arr[$row->board][$row->prefix]['value'];
 }
 $info = $forums[$row->board];
 if (is_id($row->name) && isset($memberdata[$row->name])) {
     $row->mid = $row->name;
     $row->name = $memberdata[$row->name];
 } else {
     $row->mid = FALSE;
 }
 if (is_id($row->last_name) && isset($memberdata[$row->last_name])) {
     $row->last_name = $memberdata[$row->last_name];
 }
 $rstart = str_date($lang->phrase('dformat1'), times($row->date));
 $rlast = str_date($lang->phrase('dformat1'), times($row->last));
 if ($row->status == '2') {
     $pref .= $lang->phrase('forum_moved');
 } else {
     if ($row->mark === null && !empty($info['auto_status'])) {
         $row->mark = $info['auto_status'];
     }
     if ($row->mark == 'n') {
         $pref .= $lang->phrase('forum_mark_n');
     } elseif ($row->mark == 'a') {
         $pref .= $lang->phrase('forum_mark_a');
     } elseif ($row->mark == 'b') {
         $pref .= $lang->phrase('forum_mark_b');
     } elseif ($row->mark == 'g') {
         $pref .= $lang->phrase('forum_mark_g');
     }