📄 findpost.php
字号:
<?php/*+--------------------------------------------------------------------------| Invision Power Board v2.1.5| =============================================| by Matthew Mecham| (c) 2001 - 2005 Invision Power Services, Inc.| | =============================================| Web: | Time: Wed, 01 Mar 2006 19:11:27 GMT| Release: | Licence Info: +---------------------------------------------------------------------------| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $| > $Revision: 23 $| > $Author: matt $+---------------------------------------------------------------------------|| > Find-a-post module (a.k.a: The smallest IPB class ever)| > Module written by Matt Mecham| > Date started: 14th April 2004| > Interesting Fact: I've had iTunes playing every Radiohead tune| > I own for about a week now. Thats a lot of repeats. Got some| > cool rare tracks though. Every album+rare+b sides = 6.7 hours| > music. Not bad. I need to get our more. No, you can't take the| > laptop with you - nerd.|| > Module Version Number: 1.0.0| > DBA Checked: Wed 19 May 2004| > Quality Checked: Wed 15 Sept. 2004+--------------------------------------------------------------------------*/if ( ! defined( 'IN_IPB' ) ){ print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; exit();}class findpost{ # Classes var $ipsclass; # Others var $post; function auto_run() { //----------------------------------------- // Find a post // Don't really need to check perms 'cos topic // will do that for us. Woohoop //----------------------------------------- $pid = intval($this->ipsclass->input['pid']); if ( ! $pid ) { $this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') ); } //----------------------------------------- // Get topic... //----------------------------------------- $post = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'posts', 'where' => 'pid='.$pid ) ); if ( ! $post['topic_id'] ) { $this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') ); } $this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(*) as posts', 'from' => 'posts', 'where' => "topic_id=".$post['topic_id']." AND pid <= ".$pid, ) ); $this->ipsclass->DB->simple_exec(); $cposts = $this->ipsclass->DB->fetch_row(); if ( (($cposts['posts']) % $this->ipsclass->vars['display_max_posts']) == 0 ) { $pages = ($cposts['posts']) / $this->ipsclass->vars['display_max_posts']; } else { $number = ( ($cposts['posts']) / $this->ipsclass->vars['display_max_posts'] ); $pages = ceil( $number); } $st = ($pages - 1) * $this->ipsclass->vars['display_max_posts']; $this->ipsclass->boink_it($this->ipsclass->base_url."showtopic=".$post['topic_id']."&st=$st&p=$pid"."&#entry".$pid); }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -