root/trackback/files/lib/util/TrackbackUtil.class.php @ 29

Revision 29, 1.5 kB (checked in by d0nut, 6 years ago)

many, many updates in trackback mod. bis step to 0.0.2

Line 
1<?php
2// Utils
3require_once(WBB_DIR.'lib/util/Trackback.class.php');
4
5/**
6 * trackback util
7 *
8 * @author      Torben Brodt
9 * @package     de.easy-coding.wbb.trackback
10 * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 */
12class TrackbackUtil extends Trackback {
13
14        /**
15         * Produces XML response for trackbackers with ok/error message.
16         *
17         * @param boolean $success
18         * @param string $err_response
19         * @return boolean
20         */
21        public function receive($success = false, $err_response = ""){ 
22                return parent::recieve($cussess, $err_response);
23        }
24       
25        /**
26         * @param postIDs
27         * @return u
28         */
29        public getPost($postIDs) {
30                if(!is_array($postIDs))
31                        $postIDs = array($postIDs);
32       
33                // fetch thread data
34                $sql = "SELECT          thread.*
35                        FROM            wbb".WBB_N."_post post
36                        LEFT JOIN       wbb".WBB_N."_thread thread
37                        ON              (thread.threadID=post.threadID)
38                        WHERE           postID IN (".$postIDs."); ";
39
40                $row = WCF::getDB()->getFirstRow($sql);
41                               
42                // build thread url
43                if($row && defined('SEO_REWRITE_THREAD') && SEO_REWRITE_THREAD && file_exists(WCF_DIR.'lib/page/PublicSEORewriter.class.php')) {
44                        require_once(WCF_DIR.'lib/page/PublicSEORewriter.class.php');
45                        $rewriter = new PublicSEORewriter();
46                       
47                        // public seo rewriter: cache
48                        $rewriter->publicCacheThreads($row['threadID'], $row);
49                       
50                        // public seo rewriter use
51                        return $rewriter->publicParseThreadURLs($row['threadID'], '');
52                }
53                else if($row) {
54                        return sprintf('index.php?page=Thread&threadID=%d', $row['threadID']);
55                }
56               
57                return $row;
58        }
59} 
60
61?>
Note: See TracBrowser for help on using the browser.