📄 modplugin.php
字号:
* 0 =><br> * array (<br> * 'date' => '1119770866',<br> * 'header' => 'Internet Dating More Successful than Thought',<br> * 'text' => 'Internet dating is proving a much more successful way to find long-term romance and friendship for thousands of people than was previously thought, new research shows.',<br> * ),<br> * 1 =><br> * array (<br> * 'date' => '1119770969',<br> * 'header' => 'New Dating Guide for Seniors',<br> * 'text' => 'Are you over age 65, single and thinking about entering the dating world?<br> * ',<br> * <br> * ),<br> * 2 =><br> * array (<br> * 'date' => '1237834800',<br> * 'header' => 'Women More Likely to Snoop Than Men',<br> * 'text' => 'In the new film, Little Black Book, Brittany Murphy\'s character engages in some high-tech snooping on her new boyfriend. ',<br> * ),<br> * );<br> * * @param array $param an associative array with the following keys:<br><ul> * <li>date - Unix timestamp</li> * <li>header</li> * <li>text</li></ul> * @return bool True on success. False on failure. * @access public */ function modSetNews($param ) { include_once(MODOSDATE_DIR . 'news_data.php'); $news = new newsData(); // Delete all news $news->deleteRec(false,true); // Add all news $news->addRecRows($param); return $this->_setStatus($news); } /** * determines if a zip code CSV file is loaded for a country * * @param array $param an associative array with the following keys:<br><ul> * <li>countrycode - two letter country code</li></ul> * @return bool True on success. False on failure. * @access public */ function modIsZipLoaded($param ) { include_once(MODOSDATE_DIR . 'zips_data.php'); $zips = new zipsData(); $opt['limit'] = 1; $search['countrycode'] = $param['countrycode']; if ( $zips->getRec($search,$opt) ) { $found = true; } else { $found = false; } return $found; } /** * get data for the currently logged in user * * @return array <br> * Example:<br> * Array<br> * (<br> * [id] => 104<br> * [active] => 1<br> * [username] => testuser<br> * [password] => 179ad45c6ce2cb97cf1029e212046e81<br> * [lastvisit] => 1154266346<br> * [regdate] => 1152972184<br> * [level] => 1 (role id)<br> * [timezone] => -10.00<br> * [allow_viewonline] => 1<br> * [rank] => 1<br> * [email] => dlhinkley@localhost.localdomain<br> * [country] => US<br> * [actkey] => bf45e84c32babfdcb9bce75381b7c8e5<br> * [firstname] => Test<br> * [lastname] => USer<br> * [gender] => M<br> * [lookgender] => F<br> * [lookagestart] => 16<br> * [lookageend] => 90<br> * [address_line1] => <br> * [address_line2] => <br> * [state_province] => AK<br> * [county] => sadff<br> * [city] => asdff<br> * [zip] => 12345<br> * [birth_date] => 1981-07-15<br> * [lookcountry] => US<br> * [lookstate_province] => AA<br> * [lookcounty] => <br> * [lookcity] => <br> * [lookzip] => <br> * [lookradius] => <br> * [radiustype] => <br> * [picture] => 0<br> * [status] => Active<br> * [levelend] => 1185113123<br> * [countryname] => United States<br> * [statename] => Alaska<br> * [countyname] => Herbertson<br> * [cityname] => New York<br> * [age] => 25<br> * [lastvisit_date] => 03-21-2006<br> * )<br> * * @access public */ function modGetLoggedInUser( ) { return $this->modGetUser( array('userid' => $_SESSION['UserId']) ); } /** * get data for the currently logged in admin * * @return array * @access public */ function modGetLoggedInAdmin( ) { return $this->modGetAdmin( array('adminid' => $_SESSION['AdminId']) ); } /** * get information related to the currently-loaded payment modules * * @return array * @access public */ function modGetPaymentMods( ) { include_once(MODOSDATE_DIR . 'payment_modules_data.php'); $mod = new paymentModulesData(); return $mod->getAllRec(); } /** * get all transactions for a particular user * * @param array $param an associative array with the following keys:<br><ul> * <li>userid - id of user</li></ul> * @return array * @access public */ function modGetUserTransactions( $param ) { include_once(MODOSDATE_DIR . 'transactions_data.php'); $tran = new transactionsData(); $search['user_id'] = $param['userid']; return $tran->getAllRec($search); } /** * get payment transaction information for a particular transaction * search by one or many paramaters * * @param array $param an associative array with the following keys:<br><ul> * <li>invoice_no - invoice number</li> * <li>user_id - user id</li> * <li>txn_id - transaction id</li> * <li>txn_date - transaction date</li></ul> * @return array * @access public */ function modGetTransaction( $param) { include_once(MODOSDATE_DIR . 'transactions_data.php'); $tran = new transactionsData(); return $tran->getAllRec($param); } /** * get details on a specific blog post * * @param array $param an associative array with any of the following keys:<br><ul> * <li>id - id of blog post</li> * <li>userid - id of user</li> * <li>adminid - id of admin</li> * <li>date_posted</li> * <li>title</li> * <li>story</li> * <li>views</li></ul> * @return array id, userid, adminid, date_posted, title, story, views * @access public */ function modGetBlogPost($param ) { include_once(MODOSDATE_DIR . 'blog_story_data.php'); $blog = new blogStoryData(); return $blog->getRec($param); } /** * get details on a specific blog * @param array $param an associative array with any of the following keys:<br><ul> * <li>id - id of blog</li> * <li>userid - id of user owning blog (if a user blog)</li> * <li>adminid - id of admin owning blog (if a admin blog)</li> * <li>name</li> * <li>description</li> * <li>members_comment</li> * <li>buddies_comment</li> * <li>members_vote</li> * <li>gui_editor </li> * <li>max_comments </li> * <li>bad_words </li> * <li>title_template </li> * <li>story_template</li></ul> * @return array id, userid, adminid, name, description, members_comment, buddies_comment, members_vote, gui_editor, max_comments, bad_words, title_template, story_template * @access public */ function modGetBlogInfo($param ) { include_once(MODOSDATE_DIR . 'blog_preferences_data.php'); $blog = new blogPreferencesData(); return $blog->getRec($param); } /** * get details on a plugin * @param array $param an associative array with any of the following keys:<br><ul> * <li>id - id of plugin</li> * <li>name - name of plugin</li></ul> * @return array id, name, active * @access public */ function modGetPlugin($param ) // Additional { include_once(MODOSDATE_DIR . 'plugin_data.php'); $plugin = new pluginData(); return $plugin->getRec($param); } /** * remove a specific blog post * * @param array $param an associative array with any of the following keys:<br><ul> * <li>id - id of post</li> * <li>userid - id of user owning post (if user post)</li> * <li>adminid - id of admin owning post (if adming post)</li> * <li>date_posted</li> * <li>title</li> * <li>story</li> * <li>views</li></ul> * @return bool True on success. False on failure. * @access public */ function modRemoveBlogPost( $param) { include_once(MODOSDATE_DIR . 'blog_story_data.php'); $blog = new blogStoryData(); return $blog->deleteRec($param); } /** * remove a specific blog comment * * @param array $param an associative array with the following keys:<br><ul> * <li>id - id of comment</li> * <li>userid - id of user owning comment (if user blog)</li> * <li>adminid - id of admin owning comment (if admin blog)</li> * <li>blogid - id of blog the comment belongs to</li> * <li>datetime</li> * <li>comment</li></ul> * @return bool True on success. False on failure. * @access public */ function modRemoveBlogComment($param ) { include_once(MODOSDATE_DIR . 'blog_story_data.php'); $blog = new blogStoryData(); return $blog->deleteRec($param); } /** * Returns a profile matching the search params. * * @param array $param an associative array with the following keys:<br><ul> * <li>rand - 1 to return a random profile * <li>id - return the profile matching this id</li></ul> * @return array * @access public */ function modGetProfile($param ) { include_once(MODOSDATE_DIR . 'user_data.php'); $user = new userData(); $opt = false; // If we want a random profile // if ( isset($param['rand']) ) { $opt['sort'] = "RAND()"; $opt['limit'] = "1"; /* Ignore the user id if it was just shown. Select only users who have loaded photo */ $data = $user->getRec(false,$opt); // Return all the details including country, state and age // $data = $this->modGetUser( array('userid' => $data['id']) ); } // If we just want a user id else { $data = $this->modGetUser( array('userid' => $param['id']) ); } return $data; } /** * send a message to a single user or group of users * @param array $param an associative array with the following keys:<br><ul> * <li>message - can be a templated message using user parameters in # (i.e. #firstname#, #country#))</li> * <li>rcvuserid - userid of member to receive message.</li> * <li>snduserid - userid of member to send message.</li> * <li>subject - message subject.</li> * <li>notify - set to true to notify sender when read</li></ul> * @return bool True on success. False on failure. * @access public */ function modSendMessage( $param ) { if ( isset($param['message']) && isset($param['rcvuserid']) ) { $data = $this->modGetUser( array('userid' => $param['rcvuserid']) ); $message = $this->_fillTemplate($param['message'], $data); include_once(MODOSDATE_DIR . 'mailbox_data.php'); $mail = new mailboxData(); if ( ! isset($param['notify']) ) { $param['notify'] = '0'; } // Put in inbox // $sdata['owner'] = $param['rcvuserid']; $sdata['senderid'] = $param['snduserid']; $sdata['recipientid'] = $param['rcvuserid'];; $sdata['message'] = stripEmails($message); $sdata['subject'] = stripEmails($message); $sdata['sendtime'] = time(); $sdata['folder'] = 'inbox'; $sdata['notifysender'] = $param['notify']; $mail->addRec($sdata); // Save a copy in the senders mail box // if ( ! $mail->isError() ) { $sdata['owner'] = $param['snduserid']; $sdata['senderid'] = $param['rcvuserid']; $sdata['folder'] = 'sent'; unset($sdata['notifysender']); $mail->addRec($sdata); } if ( ! $mail->isError() && $this->modGetSetting('letter_messagereceived') == 'Y' ) { $cparam = array( 'rcvuserid' => $param['rcvuserid'], 'subject' => $this->modGetSetting('site_name').' - Intimation mail', 'message' => get_lang('message_received', MAIL_FORMAT), ); $this->modSendMail( $cparam ); } } return $this->_setStatus($mail); } /** * returns the site home url * * @return string the site home url * * @access public */ function modSiteUrl() // Additional { $port = ''; if ( $_SERVER['SERVER_PORT'] != '80' ) { $port = ':' . $_SERVER['SERVER_PORT']; } return str_replace('forum/','',HTTP_METHOD . $_SERVER['SERVER_NAME'] . $port . $this->modGetDocRoot()); } /** * returns the web directory osdate resides in. * * @return directory osdate resides in. (ex. /osdate/) * * @access public */ function modGetDocRoot() // Additional { return DOC_ROOT; } /** * returns the web directory images reside in. * * @return directory osdate resides in. (ex. /osdate/) * * @access public
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -