Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <hookexport>
- <hookdata>
- <config>
- <hook_name><![CDATA[[EN34] Ajax Thanks]]></hook_name>
- <hook_desc>This hook adds the ability for members to thank posters via Ajax.</hook_desc>
- <hook_author>Elad Nava</hook_author>
- <hook_email>eladnava@gmail.com</hook_email>
- <hook_website>http://invisionize.com/</hook_website>
- <hook_update_check>http://eladnava.com/hooks.php?hook=ajaxthanks</hook_update_check>
- <hook_requirements><![CDATA[a:3:{s:21:"required_applications";a:0:{}s:20:"hook_php_version_min";s:1:"0";s:20:"hook_php_version_max";s:1:"0";}]]></hook_requirements>
- <hook_version_human>1.0.8</hook_version_human>
- <hook_version_long>10008</hook_version_long>
- <hook_extra_data><![CDATA[a:7:{s:7:"display";a:5:{s:8:"settings";s:35:"Setting groups: [EN34] Ajax Thanks";s:8:"language";s:180:"From forums_public_topic: en30_show, en30_thank, en30_thanked, en30_thanked_by, en30_thanks, en30_thank_author, en30_times, en30_unthank, en30_unthank_author, en30_user, en30_users";s:8:"database";s:105:"ALTER TABLE profile_portal ADD thanked int(10) DEFAULT '0'<br />ALTER TABLE posts ADD thankers mediumtext";s:6:"custom";s:22:"install_ajaxThanks.php";s:9:"templates";s:125:"From skin_topic: ajaxThankedCount, ajaxThankedCountProfile, ajaxThankerLink, ajaxThankersList, ajaxThanksButton, ajaxThanksJS";}s:13:"settingGroups";a:1:{s:0:"";s:15:"en30_ajaxthanks";}s:8:"settings";a:0:{}s:8:"language";a:1:{s:19:"forums_public_topic";a:11:{s:0:"";s:9:"en30_show";i:1;s:10:"en30_thank";i:2;s:12:"en30_thanked";i:3;s:15:"en30_thanked_by";i:4;s:11:"en30_thanks";i:5;s:17:"en30_thank_author";i:6;s:10:"en30_times";i:7;s:12:"en30_unthank";i:8;s:19:"en30_unthank_author";i:9;s:9:"en30_user";i:10;s:10:"en30_users";}}s:9:"templates";a:1:{s:10:"skin_topic";a:6:{s:0:"";s:16:"ajaxThankedCount";i:1;s:23:"ajaxThankedCountProfile";i:2;s:15:"ajaxThankerLink";i:3;s:16:"ajaxThankersList";i:4;s:16:"ajaxThanksButton";i:5;s:12:"ajaxThanksJS";}}s:8:"database";a:1:{s:5:"alter";a:2:{i:0;a:6:{s:9:"altertype";s:3:"add";s:5:"table";s:14:"profile_portal";s:5:"field";s:7:"thanked";s:8:"newfield";s:0:"";s:9:"fieldtype";s:7:"int(10)";s:7:"default";s:3:"'0'";}i:1;a:6:{s:9:"altertype";s:3:"add";s:5:"table";s:5:"posts";s:5:"field";s:8:"thankers";s:8:"newfield";s:0:"";s:9:"fieldtype";s:10:"mediumtext";s:7:"default";s:0:"";}}}s:6:"custom";s:14:"ajaxThanks.php";}]]></hook_extra_data>
- <hook_key>en30_ajaxthanks</hook_key>
- <hook_global_caches/>
- </config>
- </hookdata>
- <hookfiles>
- <file>
- <hook_file_real>ajaxThanksJS.php</hook_file_real>
- <hook_type>templateHooks</hook_type>
- <hook_classname>ajaxThanksJS</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:11:"skin_global";s:12:"skinFunction";s:9:"includeJS";s:4:"type";s:2:"if";s:2:"id";s:8:"minifyjs";s:8:"position";s:10:"post.endif";}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksJS
- {
- protected $registry;
- protected $settings;
- public function __construct()
- {
- $this->registry = ipsRegistry::instance();
- $this->settings =& $this->registry->fetchSettings();
- }
- public function getOutput()
- {
- if ( $this->settings['en30_ajaxthanks'] )
- {
- return $this->registry->getClass('output')->getTemplate('topic')->ajaxThanksJS();
- }
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThanksPostData.php</hook_file_real>
- <hook_type>commandHooks</hook_type>
- <hook_classname>ajaxThanksPostData</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:27:"public_forums_forums_topics";s:9:"skinGroup";N;s:12:"skinFunction";N;s:4:"type";N;s:2:"id";N;s:8:"position";N;}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksPostData extends (~extends~)
- {
- public function _getPosts()
- {
- $posts = parent::_getPosts();
- //-----------------------------------------
- // [EN31] Ajax Thanks
- //-----------------------------------------
- foreach ( $posts as $pid => $post )
- {
- //-----------------------------------------
- // INIT
- //-----------------------------------------
- $posts[ $pid ]['thanks'] = array(
- 'count' => 0,
- 'button' => 0,
- 'thankers' => array()
- );
- //-----------------------------------------
- // INIT
- //-----------------------------------------
- $thankButton = 1;
- $removeThanks = 0;
- //-----------------------------------------
- // System online?
- //-----------------------------------------
- if ( ! $this->settings['en30_ajaxthanks'] )
- {
- $thankButton = 0;
- }
- //-----------------------------------------
- // Not logged in?
- //-----------------------------------------
- if ( ! $this->memberData['member_id'] )
- {
- $thankButton = 0;
- }
- else
- {
- //-----------------------------------------
- // You can't thank yourself, silly!
- //-----------------------------------------
- if ( $this->memberData['member_id'] == $posts[ $pid ]['author_id'] )
- {
- $thankButton = 0;
- }
- }
- //-----------------------------------------
- // Only first post can be thanked?
- //-----------------------------------------
- if ( $this->settings['en30_thankfirstonly'] && ! $posts[ $pid ]['new_topic'] )
- {
- $thankButton = 0;
- }
- //-----------------------------------------
- // Forum excluded?
- //-----------------------------------------
- $topicData = $this->registry->getClass('topics')->getTopicData();
- if ( $topicData )
- {
- $fid = $topicData['forum_id'];
- if ( in_array( $fid, explode( ",", $this->settings['en30_ajaxthanksforums'] ) ) )
- {
- $thankButton = 0;
- }
- }
- //-----------------------------------------
- // Member group excluded?
- //-----------------------------------------
- if ( in_array( $this->memberData['member_group_id'], explode( ",", $this->settings['en30_ajaxthanksgroups'] ) ) )
- {
- $thankButton = 0;
- }
- //-----------------------------------------
- // Post has been thanked before?
- //-----------------------------------------
- if ( ! empty( $posts[ $pid ]['thankers'] ) )
- {
- //-----------------------------------------
- // Unserialize thankers list
- //-----------------------------------------
- $thankers = unserialize( stripslashes( $posts[ $pid ]['thankers'] ) );
- //-----------------------------------------
- // INIT
- //-----------------------------------------
- $posts[ $pid ]['thanks']['count'] = count( $thankers );
- $posts[ $pid ]['thankers'] = "";
- //-----------------------------------------
- // Already thanked this post?
- //-----------------------------------------
- if ( array_key_exists( $this->memberData['member_id'], $thankers ) )
- {
- $thankButton = 0;
- $removeThanks = 1;
- }
- //-----------------------------------------
- // Link thankers list
- //-----------------------------------------
- foreach ( $thankers as $mid => $name )
- {
- $posts[ $pid ]['thanks']['thankers'][] = $this->registry->getClass('output')->getTemplate('topic')->ajaxThankerLink( $mid, $name, IPSText::makeSeoTitle( $name ) );
- }
- }
- //-----------------------------------------
- // Show/hide thanks button
- //-----------------------------------------
- if ( $thankButton )
- {
- $posts[ $pid ]['thanks']['button'] = 'thank';
- }
- else if ( $removeThanks )
- {
- $posts[ $pid ]['thanks']['button'] = 'remove';
- }
- else
- {
- $posts[ $pid ]['thanks']['button'] = 'none';
- }
- }
- return $posts;
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThanksDummy.php</hook_file_real>
- <hook_type>templateHooks</hook_type>
- <hook_classname>ajaxThanksDummy</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:10:"skin_topic";s:12:"skinFunction";s:4:"post";s:4:"type";s:2:"if";s:2:"id";s:7:"canEdit";s:8:"position";s:11:"pre.startif";}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksDummy
- {
- public function __construct()
- {
- // The purpose of this file is to prevent IPB from skipping
- // hook duties for the Topic View -> 'post' template bit
- }
- public function getOutput()
- {
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThanksButton.php</hook_file_real>
- <hook_type>templateHooks</hook_type>
- <hook_classname>ajaxThanksButton</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:10:"skin_topic";s:12:"skinFunction";s:17:"topicViewTemplate";s:4:"type";s:7:"foreach";s:2:"id";s:9:"post_data";s:8:"position";s:10:"outer.post";}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksButton
- {
- protected $registry;
- protected $settings;
- public function __construct()
- {
- $this->registry = ipsRegistry::instance();
- $this->settings =& $this->registry->fetchSettings();
- }
- public function getOutput()
- {
- }
- public function replaceOutput( $output, $key )
- {
- $tag = '<!--hook.if.skin_topic.post.canEdit.pre.startif-->';
- $lastFound = 0;
- foreach( $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['post_data'] as $post )
- {
- if ( ! $post['post']['_isDeleted'] )
- {
- $pos = strpos( $output, $tag, $lastFound );
- $strToInsert = $this->registry->output->replaceMacros( $this->registry->getClass('output')->getTemplate('topic')->ajaxThanksButton( $post ) );
- if ( $pos )
- {
- $output = substr_replace( $output, $strToInsert . $tag, $pos, strlen( $tag ) );
- $lastFound = $pos + strlen( $tag . $strToInsert );
- }
- }
- }
- return $output;
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThanksProfileView.php</hook_file_real>
- <hook_type>templateHooks</hook_type>
- <hook_classname>ajaxThanksProfileView</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:12:"skin_profile";s:12:"skinFunction";s:13:"profileModern";s:4:"type";s:2:"if";s:2:"id";s:8:"pcfields";s:8:"position";s:10:"post.endif";}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksProfileView
- {
- protected $registry;
- protected $DB;
- protected $request;
- protected $settings;
- protected $memberData;
- public function __construct()
- {
- $this->registry = ipsRegistry::instance();
- $this->DB = $this->registry->DB();
- $this->request =& $this->registry->fetchRequest();
- $this->settings =& $this->registry->fetchSettings();
- $this->memberData =& $this->registry->member()->fetchMemberData();
- }
- public function getOutput()
- {
- if ( $this->settings['en30_ajaxthanks'] )
- {
- //-----------------------------------------
- // Load public_topic lang file
- //-----------------------------------------
- $this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_topic' ), 'forums' );
- //-----------------------------------------
- // Get the member array
- //-----------------------------------------
- $member = $this->registry->output->getTemplate('profile')->functionData['profileModern'][0]['member'];
- //-----------------------------------------
- // Show thanked count
- //-----------------------------------------
- return $this->registry->getClass('output')->getTemplate('topic')->ajaxThankedCountProfile( $member );
- }
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThankersList.php</hook_file_real>
- <hook_type>templateHooks</hook_type>
- <hook_classname>ajaxThankersList</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:10:"skin_topic";s:12:"skinFunction";s:17:"topicViewTemplate";s:4:"type";s:7:"foreach";s:2:"id";s:9:"post_data";s:8:"position";s:10:"inner.post";}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThankersList
- {
- protected $registry;
- protected $settings;
- public function __construct()
- {
- $this->registry = ipsRegistry::instance();
- $this->settings =& $this->registry->fetchSettings();
- }
- public function getOutput()
- {
- }
- public function replaceOutput( $output, $key )
- {
- $tag = '<!--hook.'.$key.'-->';
- $lastFound = 0;
- foreach( $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['post_data'] as $pid => $post )
- {
- $pos = strpos( $output, $tag, $lastFound );
- $strToInsert = $this->registry->output->replaceMacros( $this->registry->getClass('output')->getTemplate('topic')->ajaxThankersList( $post ) );
- if ( $pos )
- {
- $output = substr_replace( $output, $strToInsert . $tag, $pos, strlen( $tag ) );
- $lastFound = $pos + strlen( $tag . $strToInsert );
- }
- }
- return $output;
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThanksInfoPane.php</hook_file_real>
- <hook_type>templateHooks</hook_type>
- <hook_classname>ajaxThanksInfoPane</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:0:"";s:9:"skinGroup";s:11:"skin_global";s:12:"skinFunction";s:12:"userInfoPane";s:4:"type";s:2:"if";s:2:"id";s:9:"postCount";s:8:"position";s:10:"post.endif";}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksInfoPane
- {
- protected $registry;
- protected $settings;
- public function __construct()
- {
- $this->registry = ipsRegistry::instance();
- $this->settings =& $this->registry->fetchSettings();
- }
- public function getOutput()
- {
- }
- public function replaceOutput( $output, $key )
- {
- $tag = '<!--hook.'.$key.'-->';
- $lastFound = 0;
- foreach( $this->registry->output->getTemplate('global')->functionData['userInfoPane'] as $mid => $author )
- {
- $author = $author['author'];
- $pos = strpos( $output, $tag, $lastFound );
- $strToInsert = $this->registry->output->replaceMacros( $this->registry->getClass('output')->getTemplate('topic')->ajaxThankedCount( $author ) );
- if ( $pos )
- {
- $output = substr_replace( $output, $strToInsert . $tag, $pos, strlen( $tag ) );
- $lastFound = $pos + strlen( $tag . $strToInsert );
- }
- }
- return $output;
- }
- }
- ?>]]></hooks_source>
- </file>
- <file>
- <hook_file_real>ajaxThanksAdd.php</hook_file_real>
- <hook_type>commandHooks</hook_type>
- <hook_classname>ajaxThanksAdd</hook_classname>
- <hook_data><![CDATA[a:8:{s:12:"dataLocation";s:0:"";s:14:"libApplication";s:0:"";s:15:"classToOverload";s:24:"public_forums_ajax_stats";s:9:"skinGroup";N;s:12:"skinFunction";N;s:4:"type";N;s:2:"id";N;s:8:"position";N;}]]></hook_data>
- <hooks_source><![CDATA[<?php
- class ajaxThanksAdd extends (~extends~)
- {
- public $registry;
- public function doExecute( ipsRegistry $registry )
- {
- switch( $this->request['do'] )
- {
- case 'ajaxThanks':
- $this->doAjaxThanks( $registry );
- break;
- case 'ajaxRemoveThanks':
- $this->removeAjaxThanks( $registry );
- break;
- default:
- parent::doExecute( $registry );
- break;
- }
- }
- private function removeAjaxThanks( ipsRegistry $registry )
- {
- //-----------------------------------------
- // INIT
- //-----------------------------------------
- $pid = intval( $this->request['pid'] );
- $fid = intval( $this->request['fid'] );
- $tid = intval( $this->request['tid'] );
- //-----------------------------------------
- // Permissions
- //-----------------------------------------
- if ( ! $pid || ! $tid || ! $fid )
- {
- $this->returnJsonError( 'No post/topic/forum passed.' );
- }
- $pass = 1;
- if ( ! $this->settings['en30_ajaxthanks'] )
- {
- // Mod is off
- $pass = 0;
- }
- if ( ! $this->memberData['member_id'] )
- {
- // Must be logged in
- $pass = 0;
- }
- if ( in_array( $fid, explode( ",", $this->settings['en30_ajaxthanksforums'] ) ) )
- {
- // Forum excluded
- $pass = 0;
- }
- if ( in_array( $this->memberData['member_group_id'], explode( ",", $this->settings['en30_ajaxthanksgroups'] ) ) )
- {
- // Group excluded
- $pass = 0;
- }
- if ( ! $pass )
- {
- $this->returnJsonError( 'Unauthorized action.' );
- }
- $post = $this->DB->buildAndFetch( array( 'select' => 'author_id, thankers, new_topic', 'from' => 'posts', 'where' => "pid = '{$pid}' AND topic_id = '{$tid}'" ) );
- if ( ! $this->DB->getTotalRows() )
- {
- $this->returnJsonError( 'Invalid post or topic ID.' );
- }
- if ( ! empty( $post['thankers'] ) )
- {
- $post['thankers'] = unserialize( stripslashes( $post['thankers'] ) );
- if ( ! array_key_exists( $this->memberData['member_id'], $post['thankers'] ) )
- {
- $this->returnJsonError( "You haven't thanked this topic yet." );
- }
- unset( $post['thankers'][ $this->memberData['member_id'] ] );
- }
- else
- {
- $this->returnJsonError( "No one has thanked this topic yet." );
- }
- $serialized = addslashes( serialize( $post['thankers'] ) );
- $this->DB->update( 'posts', array( 'thankers' => $serialized ), 'pid='.$pid );
- $this->DB->update( 'profile_portal', 'thanked=thanked-1', 'pp_member_id='.$post['author_id'], false, true );
- foreach ( $post['thankers'] as $mid => $name )
- {
- $thankers .= $this->registry->getClass('output')->getTemplate('topic')->ajaxThankerLink( $mid, $name, IPSText::makeSeoTitle( $name ) );
- }
- $this->returnJsonArray( array( 'member_id' => $this->memberData['member_id'],
- 'members_display_name' => $this->memberData['members_display_name'],
- 'thankers' => $thankers
- ) );
- }
- private function doAjaxThanks( ipsRegistry $registry )
- {
- //-----------------------------------------
- // INIT
- //-----------------------------------------
- $pid = intval( $this->request['pid'] );
- $fid = intval( $this->request['fid'] );
- $tid = intval( $this->request['tid'] );
- //-----------------------------------------
- // Permissions
- //-----------------------------------------
- if ( ! $pid || ! $tid || ! $fid )
- {
- $this->returnJsonError( 'No post/topic/forum passed.' );
- }
- $pass = 1;
- if ( ! $this->settings['en30_ajaxthanks'] )
- {
- // Mod is off
- $pass = 0;
- }
- if ( ! $this->memberData['member_id'] )
- {
- // Must be logged in
- $pass = 0;
- }
- if ( in_array( $fid, explode( ",", $this->settings['en30_ajaxthanksforums'] ) ) )
- {
- // Forum excluded
- $pass = 0;
- }
- if ( in_array( $this->memberData['member_group_id'], explode( ",", $this->settings['en30_ajaxthanksgroups'] ) ) )
- {
- // Group excluded
- $pass = 0;
- }
- if ( ! $pass )
- {
- $this->returnJsonError( 'Unauthorized action.' );
- }
- $post = $this->DB->buildAndFetch( array( 'select' => 'author_id, thankers, new_topic', 'from' => 'posts', 'where' => "pid = '{$pid}' AND topic_id = '{$tid}'" ) );
- if ( ! $this->DB->getTotalRows() )
- {
- $this->returnJsonError( 'Invalid post or topic ID.' );
- }
- if ( $post['author_id'] == $this->memberData['member_id'] )
- {
- $this->returnJsonError( 'You can\'t thank yourself, silly!' );
- }
- if ( $this->settings['en30_thankfirstonly'] && ! $post['new_topic'] )
- {
- $this->returnJsonError( 'You are not allowed to thank topic replies.' );
- }
- $thankers = array( $this->memberData['member_id'] => $this->memberData['members_display_name'] );
- if ( ! empty( $post['thankers'] ) )
- {
- $post['thankers'] = unserialize( stripslashes( $post['thankers'] ) );
- if ( array_key_exists( $this->memberData['member_id'], $post['thankers'] ) )
- {
- $this->returnJsonError( 'You have already thanked this topic.' );
- }
- foreach ( $post['thankers'] as $k => $v )
- {
- $thankers[ $k ] = $v;
- }
- }
- $thankers = addslashes( serialize( $thankers ) );
- $this->DB->update( 'posts', array( 'thankers' => $thankers ), 'pid='.$pid );
- $this->DB->update( 'profile_portal', 'thanked=thanked+1', 'pp_member_id='.$post['author_id'], false, true );
- $postContent = "";
- if ( $this->settings['en30_ajaxthankshidehack'] && isset( $this->settings['tb_hc_groups'] ) )
- {
- $this->DB->build( array( 'select' => '*', 'from' => 'posts', 'where' => 'pid='.$pid ) );
- $this->DB->execute();
- $row = $this->DB->fetch();
- if ( ! is_object( $this->postClass ) )
- {
- require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/post/classPost.php" );
- require_once( IPSLib::getAppDir( 'forums' ) . "/sources/classes/post/classPostForms.php" );
- $this->registry->getClass( 'class_localization')->loadLanguageFile( array( 'public_editors' ), 'core' );
- $this->postClass = new classPostForms( $this->registry );
- }
- $this->cache->updateCacheWithoutSaving( 'tb_hide_topic', array( 'tid' => $tid, 'starter_id' => $post['author_id'], 'last_poster_id' => $this->memberData['member_id'] ) );
- //-----------------------------------------
- // Pre-display-parse
- //-----------------------------------------
- IPSText::getTextClass( 'bbcode' )->parse_smilies = $row['use_emo'];
- IPSText::getTextClass( 'bbcode' )->parse_html = ( $this->registry->getClass('class_forums')->forum_by_id[ $fid ]['use_html'] and $this->memberData['g_dohtml'] and $row['post_htmlstate'] ) ? 1 : 0;
- IPSText::getTextClass( 'bbcode' )->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
- IPSText::getTextClass( 'bbcode' )->parse_bbcode = 1;
- IPSText::getTextClass( 'bbcode' )->parsing_section = 'topics';
- IPSText::getTextClass( 'bbcode' )->parsing_mgroup = $this->postClass->getAuthor('member_group_id');
- IPSText::getTextClass( 'bbcode' )->parsing_mgroup_others = $this->postClass->getAuthor('mgroup_others');
- $postContent = IPSText::getTextClass( 'bbcode' )->preDisplayParse( $row['post'] );
- //-----------------------------------------
- // Attachments
- //-----------------------------------------
- $classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );
- $this->class_attach = new $classToLoad( $this->registry );
- $this->class_attach->type = 'post';
- $this->class_attach->init();
- if ( IPSMember::checkPermissions('download') === false )
- {
- $this->settings['show_img_upload'] = 0;
- }
- $postContent = $this->class_attach->renderAttachments( $postContent, array( $row['pid'] => $row['pid'] ) );
- $postContent = $postContent[0]['html'];
- //-----------------------------------------
- // Macros...
- //-----------------------------------------
- $postContent = $this->registry->output->replaceMacros( $postContent );
- }
- $this->returnJsonArray( array( 'member_id' => $this->memberData['member_id'],
- 'members_display_name' => $this->memberData['members_display_name'],
- 'post' => $postContent
- ) );
- }
- }
- ?>]]></hooks_source>
- </file>
- </hookfiles>
- <hookextras_custom>
- <file>
- <filename>ajaxThanks.php</filename>
- <source><![CDATA[<?php
- class ajaxThanks
- {
- protected $registry;
- protected $DB;
- public function __construct( ipsRegistry $registry )
- {
- $this->registry = $registry;
- $this->DB = $this->registry->DB();
- }
- public function install()
- {
- //-----------------------------------------
- // Migrate thanked count to profile_portal
- //-----------------------------------------
- $prefix = $this->registry->dbFunctions()->getPrefix();
- //-----------------------------------------
- // Is this a fresh install?
- //-----------------------------------------
- $post = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'posts', 'limit' => array( 0, 1 ) ) );
- if ( isset( $post['thanked'] ) )
- {
- $this->DB->build( array(
- 'update' => "profile_portal p, {$prefix}members m",
- 'set' => 'p.thanked = m.thanked',
- 'where' => 'm.thanked > 0 AND p.pp_member_id = m.member_id'
- ) );
- $this->DB->execute();
- }
- }
- public function uninstall()
- {
- }
- }
- ?>]]></source>
- </file>
- </hookextras_custom>
- <hookextras_settings>
- <setting>
- <conf_is_title>1</conf_is_title>
- <conf_title_title><![CDATA[ [EN34] Ajax Thanks]]></conf_title_title>
- <conf_title_desc><![CDATA[Settings for the [EN34] Ajax Thanks modification by Elad Nava.]]></conf_title_desc>
- <conf_title_noshow>0</conf_title_noshow>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_title_app>core</conf_title_app>
- <conf_title_tab>System</conf_title_tab>
- </setting>
- <setting>
- <conf_id>315</conf_id>
- <conf_title>System online?</conf_title>
- <conf_description>Master switch.</conf_description>
- <conf_group>31</conf_group>
- <conf_type>yes_no</conf_type>
- <conf_key>en30_ajaxthanks</conf_key>
- <conf_value/>
- <conf_default>1</conf_default>
- <conf_extra/>
- <conf_evalphp/>
- <conf_protected>1</conf_protected>
- <conf_position>1</conf_position>
- <conf_start_group>Functionality</conf_start_group>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>319</conf_id>
- <conf_title>Collapse thankers?</conf_title>
- <conf_description>This setting will collapse the thankers box if the amount of thankers exceeds the number specified in the setting below.</conf_description>
- <conf_group>31</conf_group>
- <conf_type>yes_no</conf_type>
- <conf_key>en30_ajaxthankscollapse</conf_key>
- <conf_value/>
- <conf_default>1</conf_default>
- <conf_extra/>
- <conf_evalphp/>
- <conf_protected>1</conf_protected>
- <conf_position>5</conf_position>
- <conf_start_group>Collapsing</conf_start_group>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>317</conf_id>
- <conf_title>Disable thanking in certain forums?</conf_title>
- <conf_description>Select forum(s) in which members cannot thank posters.</conf_description>
- <conf_group>31</conf_group>
- <conf_type>multi</conf_type>
- <conf_key>en30_ajaxthanksforums</conf_key>
- <conf_value/>
- <conf_default/>
- <conf_extra>#show_forums#</conf_extra>
- <conf_evalphp><![CDATA[if ( $save == 1)
- {
- if ( is_array($_POST['en30_ajaxthanksforums']) )
- {
- $_POST['en30_ajaxthanksforums'] = implode(",",$_POST['en30_ajaxthanksforums']);
- }
- else
- {
- $_POST['en30_ajaxthanksforums'] = "";
- }
- $key = 'en30_ajaxthanksforums';
- }
- if ( $show == 1 )
- {
- $key = 'en30_ajaxthanksforums[]';
- }]]></conf_evalphp>
- <conf_protected>1</conf_protected>
- <conf_position>4</conf_position>
- <conf_start_group/>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>316</conf_id>
- <conf_title>Exclude groups from thanking?</conf_title>
- <conf_description>Select group(s) that will not be able to thank posters.</conf_description>
- <conf_group>31</conf_group>
- <conf_type>multi</conf_type>
- <conf_key>en30_ajaxthanksgroups</conf_key>
- <conf_value/>
- <conf_default/>
- <conf_extra>#show_groups#</conf_extra>
- <conf_evalphp><![CDATA[if ( $save == 1)
- {
- if ( is_array($_POST['en30_ajaxthanksgroups']) )
- {
- $_POST['en30_ajaxthanksgroups'] = implode(",",$_POST['en30_ajaxthanksgroups']);
- }
- else
- {
- $_POST['en30_ajaxthanksgroups'] = "";
- }
- $key = 'en30_ajaxthanksgroups';
- }
- if ( $show == 1 )
- {
- $key = 'en30_ajaxthanksgroups[]';
- }]]></conf_evalphp>
- <conf_protected>1</conf_protected>
- <conf_position>3</conf_position>
- <conf_start_group>Permissions</conf_start_group>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>318</conf_id>
- <conf_title>Enable integration?</conf_title>
- <conf_description><![CDATA[Reveal hidden content to thankers automatically after thanking a post if <a href="http://www.invisionbyte.net/index.php?showtopic=3055" target="_blank" title="(T30) Hide Content">(T30) Hide Content</a> is installed?]]></conf_description>
- <conf_group>31</conf_group>
- <conf_type>yes_no</conf_type>
- <conf_key>en30_ajaxthankshidehack</conf_key>
- <conf_value/>
- <conf_default>1</conf_default>
- <conf_extra/>
- <conf_evalphp/>
- <conf_protected>1</conf_protected>
- <conf_position>7</conf_position>
- <conf_start_group>(T30) Hide Content Integration</conf_start_group>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>320</conf_id>
- <conf_title>Number of thankers to trigger collapse</conf_title>
- <conf_description>Specify the minimum number of thankers to cause the thankers box to collapse. The setting above must be enabled for this to have any effect.</conf_description>
- <conf_group>31</conf_group>
- <conf_type>input</conf_type>
- <conf_key>en30_ajaxthanksmaxthankers</conf_key>
- <conf_value/>
- <conf_default>25</conf_default>
- <conf_extra/>
- <conf_evalphp/>
- <conf_protected>1</conf_protected>
- <conf_position>6</conf_position>
- <conf_start_group/>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>321</conf_id>
- <conf_title>Disable thanking topic replies?</conf_title>
- <conf_description>Allow thanking only the first post in a topic?</conf_description>
- <conf_group>31</conf_group>
- <conf_type>yes_no</conf_type>
- <conf_key>en30_thankfirstonly</conf_key>
- <conf_value/>
- <conf_default>0</conf_default>
- <conf_extra/>
- <conf_evalphp/>
- <conf_protected>1</conf_protected>
- <conf_position>2</conf_position>
- <conf_start_group/>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- <setting>
- <conf_id>322</conf_id>
- <conf_title>Allow members to remove thanks?</conf_title>
- <conf_description>Do you want to allow members to remove their thanks, if they clicked the button by accident?</conf_description>
- <conf_group>31</conf_group>
- <conf_type>yes_no</conf_type>
- <conf_key>en31_remove_thanks</conf_key>
- <conf_value/>
- <conf_default>1</conf_default>
- <conf_extra/>
- <conf_evalphp/>
- <conf_protected>1</conf_protected>
- <conf_position>8</conf_position>
- <conf_start_group>Убрать благодарность</conf_start_group>
- <conf_add_cache>1</conf_add_cache>
- <conf_keywords/>
- <conf_title_keyword>en30_ajaxthanks</conf_title_keyword>
- <conf_is_title>0</conf_is_title>
- </setting>
- </hookextras_settings>
- <hookextras_language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_user</word_key>
- <word_default>пользователей:</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_users</word_key>
- <word_default>пользователей:</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_unthank_author</word_key>
- <word_default>Убрать благодарность с сообщения</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_unthank</word_key>
- <word_default>Убрать благодарность</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_times</word_key>
- <word_default>times</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_thanked_by</word_key>
- <word_default>Поблагодарили за полезное сообщение</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_thank_author</word_key>
- <word_default>Поблагодарить автора за полезное сообщение</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_thanks</word_key>
- <word_default>Получено благодарностей</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_thanked</word_key>
- <word_default>Thanked</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_thank</word_key>
- <word_default>Поблагодарить</word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- <language>
- <word_app>forums</word_app>
- <word_pack>public_topic</word_pack>
- <word_key>en30_show</word_key>
- <word_default><![CDATA[[Show]]]></word_default>
- <word_custom/>
- <word_js>0</word_js>
- </language>
- </hookextras_language>
- <hookextras_modules/>
- <hookextras_help/>
- <hookextras_templates>
- <templates>
- <template_group>skin_topic</template_group>
- <template_content><![CDATA[ <if test="ajaxThanksEnabled:|:$this->settings['en30_ajaxthanks']">
- <li class="post_count desc lighter">
- {$author['thanked']} {$this->lang->words['en30_thanks']}
- </li>
- </if>
- ]]></template_content>
- <template_name>ajaxThankedCount</template_name>
- <template_data>$author</template_data>
- <template_updated>1311325211</template_updated>
- <template_removable>1</template_removable>
- <template_added_to>0</template_added_to>
- <template_user_added>1</template_user_added>
- <template_user_edited>1</template_user_edited>
- <template_master_key>root</template_master_key>
- <template_set_id>0</template_set_id>
- </templates>
- <templates>
- <template_group>skin_topic</template_group>
- <template_content><![CDATA[ <li>
- <span class='row_title'>{$this->lang->words['en30_thanked']}</span>
- <span class='row_data'>{$member['thanked']} {$this->lang->words['en30_times']}</span>
- </li>]]></template_content>
- <template_name>ajaxThankedCountProfile</template_name>
- <template_data>$пользователей</template_data>
- <template_updated>1311324842</template_updated>
- <template_removable>1</template_removable>
- <template_added_to>0</template_added_to>
- <template_user_added>1</template_user_added>
- <template_user_edited>1</template_user_edited>
- <template_master_key>root</template_master_key>
- <template_set_id>0</template_set_id>
- </templates>
- <templates>
- <template_group>skin_topic</template_group>
- <template_content><![CDATA[<php>$member = array( 'member_id' => $mid, 'members_display_name' => $name, 'members_seo_name' => $seoName );</php>
- <span class="author vcard">{parse template="userHoverCard" group="global" params="$member"}</span>]]></template_content>
- <template_name>ajaxThankerLink</template_name>
- <template_data>$mid, $name, $seoName</template_data>
- <template_updated>1311257015</template_updated>
- <template_removable>1</template_removable>
- <template_added_to>0</template_added_to>
- <template_user_added>1</template_user_added>
- <template_user_edited>1</template_user_edited>
- <template_master_key>root</template_master_key>
- <template_set_id>0</template_set_id>
- </templates>
- <templates>
- <template_group>skin_topic</template_group>
- <template_content><![CDATA[<if test="ajaxThanksEnabled:|:$this->settings['en30_ajaxthanks'] && $post['post']['thanks']['count'] != 0">
- <div class="row2" id="thankersBox_{$post['post']['pid']}" title="visible" style="padding: 4px 0 4px 0">
- <table class="ipb_table" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
- <tbody>
- <tr valign="top">
- <td width="1%" nowrap="nowrap">
- <div id="thankedBy_{$post['post']['pid']}" title="{$post['post']['thanks']['count']}" style="font-weight: bold">{$this->lang->words['en30_thanked_by']} {$post['post']['thanks']['count']} <if test="isPlural:|:$post['post']['thanks']['count'] == 1">{$this->lang->words['en30_user']}<else />{$this->lang->words['en30_users']}</if></div>
- </td>
- <td width="99%">
- <div id="thankers_{$post['post']['pid']}" <if test="collapseThankers:|:$this->settings['en30_ajaxthankscollapse'] && $post['post']['thanks']['count'] > $this->settings['en30_ajaxthanksmaxthankers']">style="display: none;"</if>>
- {parse expression="implode( ", ", $post['post']['thanks']['thankers'] )"}
- </div>
- <if test="collapseThankers2:|:$this->settings['en30_ajaxthankscollapse'] && $post['post']['thanks']['count'] > $this->settings['en30_ajaxthanksmaxthankers']">
- <div id="show_thankers_{$post['post']['pid']}">
- <a href="javascript: ajaxThanksExpand( '{$post['post']['pid']}' );">{$this->lang->words['en30_show']}</a>
- </div>
- <else />
- <div id="show_thankers_{$post['post']['pid']}" style="display: none;"></div>
- </if>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <else />
- <div class="row2" id="thankersBox_{$post['post']['pid']}" title="hidden" style="padding: 4px 0 4px 0; display: none">
- <table class="ipb_table" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
- <tbody>
- <tr valign="top">
- <td width="1%" nowrap="nowrap">
- <div id="thankedBy_{$post['post']['pid']}" title="0" style="font-weight: bold">{$this->lang->words['en30_thanked_by']} 1 {$this->lang->words['en30_user']}</div>
- </td>
- <td width="99%">
- <div id="thankers_{$post['post']['pid']}">{$post['post']['thankers']}</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </if>]]></template_content>
- <template_name>ajaxThankersList</template_name>
- <template_data>$post</template_data>
- <template_updated>1311256223</template_updated>
- <template_removable>1</template_removable>
- <template_added_to>0</template_added_to>
- <template_user_added>1</template_user_added>
- <template_user_edited>1</template_user_edited>
- <template_master_key>root</template_master_key>
- <template_set_id>0</template_set_id>
- </templates>
- <templates>
- <template_group>skin_topic</template_group>
- <template_content><![CDATA[ <if test="ajaxThanksButton:|:$post['post']['thanks']['button'] == 'thank'">
- <li class='ajax_thanks' id='ajaxThanks_{$post['post']['pid']}'>
- <a href="javascript: ajaxThanks( '{$post['post']['pid']}' );" title='{$this->lang->words['en30_thank_author']}' class='ipsButton_secondary'>{$this->lang->words['en30_thank']}</a>
- </li>
- </if>
- <if test="ajaxThanksButton:|:$post['post']['thanks']['button'] == 'remove' && $this->settings['en31_remove_thanks']">
- <li class='ajax_thanks' id='ajaxRemoveThanks_{$post['post']['pid']}'>
- <a href="javascript: ajaxRemoveThanks( '{$post['post']['pid']}' );" title='{$this->lang->words['en30_unthank_author']}' class='ipsButton_secondary'>{$this->lang->words['en30_unthank']}</a>
- </li>
- </if>]]></template_content>
- <template_name>ajaxThanksButton</template_name>
- <template_data>$post</template_data>
- <template_updated>1311257864</template_updated>
- <template_removable>1</template_removable>
- <template_added_to>0</template_added_to>
- <template_user_added>1</template_user_added>
- <template_user_edited>1</template_user_edited>
- <template_master_key>root</template_master_key>
- <template_set_id>0</template_set_id>
- </templates>
- <templates>
- <template_group>skin_topic</template_group>
- <template_content><![CDATA[<script type='text/javascript'>
- ipb.lang['en30_thanked_by'] = "{$this->lang->words['en30_thanked_by']}";
- ipb.lang['en30_thank'] = "{$this->lang->words['en30_thank']}";
- ipb.lang['en30_thank_author'] = "{$this->lang->words['en30_thank_author']}";
- ipb.lang['en30_user'] = "{$this->lang->words['en30_user']}";
- ipb.lang['en30_users'] = "{$this->lang->words['en30_users']}";
- ipb.lang['en30_thanked'] = "{$this->lang->words['en30_thanked']}";
- function ajaxThanksExpand( pid )
- {
- var thankersBox = $( 'thankers_' + pid );
- var showThankers = $( 'show_thankers_' + pid );
- showThankers.style.display = "none";
- thankersBox.style.display = "block";
- }
- function ajaxRemoveThanks( pid )
- {
- // Kill the thanks button of this specific post
- new Effect.DropOut( 'ajaxRemoveThanks_' + pid );
- var url = ipb.vars['base_url'] + 'app=forums&module=ajax§ion=stats&do=ajaxRemoveThanks';
- new Ajax.Request( url,
- {
- method: 'post',
- evalJSON: 'force',
- parameters: {
- md5check: ipb.vars['secure_hash'],
- pid: pid,
- tid: ipb.topic.topic_id,
- fid: ipb.topic.forum_id
- },
- onSuccess: function(t)
- {
- if( t.responseJSON['error'] )
- {
- alert( t.responseJSON['error'] );
- }
- else
- {
- var thankers = $( 'thankers_' + pid );
- var thankedBy = $( 'thankedBy_' + pid );
- var thankersBox = $( 'thankersBox_' + pid );
- if ( thankersBox.getAttribute( 'title' ) == 'hidden' )
- {
- thankersBox.style.display = "block";
- thankers.innerHTML = t.responseJSON['thankers'];
- }
- else
- {
- ajaxThanksExpand( pid );
- thankers.innerHTML = t.responseJSON['thankers'];
- }
- if ( thankersBox.getAttribute( 'title' ) == 'hidden' )
- {
- thankersBox.style.display = "block";
- }
- // Update thanked by text (increment number show plural)
- if ( thankedBy.title != '0' )
- {
- var thankers = parseInt( thankedBy.title ) - 1;
- if ( thankers > 1 )
- {
- thankedBy.innerHTML = ipb.lang['en30_thanked_by'] + ' ' + thankers + ' ' + ipb.lang['en30_users'];
- new Effect.Pulsate( thankersBox, { pulses: 3, duration: 1.5 } );
- }
- if ( thankers == 1 )
- {
- thankedBy.innerHTML = ipb.lang['en30_thanked_by'] + ' ' + thankers + ' ' + ipb.lang['en30_user'];
- new Effect.Pulsate( thankersBox, { pulses: 3, duration: 1.5 } );
- }
- else
- {
- thankersBox.style.display = "none";
- }
- }
- }
- }
- }
- );
- }
- function ajaxThanks( pid )
- {
- // Kill the thanks button of this specific post
- new Effect.DropOut( 'ajaxThanks_' + pid );
- var url = ipb.vars['base_url'] + 'app=forums&module=ajax§ion=stats&do=ajaxThanks';
- new Ajax.Request( url,
- {
- method: 'post',
- evalJSON: 'force',
- parameters: {
- md5check: ipb.vars['secure_hash'],
- pid: pid,
- tid: ipb.topic.topic_id,
- fid: ipb.topic.forum_id
- },
- onSuccess: function(t)
- {
- if( t.responseJSON['error'] )
- {
- alert( t.responseJSON['error'] );
- }
- else
- {
- var thankers = $( 'thankers_' + pid );
- var thankedBy = $( 'thankedBy_' + pid );
- var thankersBox = $( 'thankersBox_' + pid );
- var newLink = "<a href='" + ipb.vars['base_url'] + "showuser=" + t.responseJSON['member_id'] + "' title='" + t.responseJSON['members_display_name'] + "'>" + t.responseJSON['members_display_name'] + "</a>" + " <a href='" + ipb.vars['base_url'] + "showuser=" + t.responseJSON['member_id'] + "' class='__user __id" + t.responseJSON['member_id'] + "' title='{$this->lang->words['view_profile']}'>{parse replacement="user_popup"}</a>";
- if ( thankersBox.getAttribute( 'title' ) == 'hidden' )
- {
- thankersBox.style.display = "block";
- thankers.innerHTML = newLink;
- }
- else
- {
- ajaxThanksExpand( pid );
- thankers.innerHTML = newLink + ", " + thankers.innerHTML;
- }
- if ( thankersBox.getAttribute( 'title' ) == 'hidden' )
- {
- thankersBox.style.display = "block";
- }
- // Update thanked by text (increment number show plural)
- if ( thankedBy.title != '0' )
- {
- thankedBy.innerHTML = ipb.lang['en30_thanked_by'] + ' ' + ( parseInt( thankedBy.title ) + 1 ) + ' ' + ipb.lang['en30_users'];
- }
- // Update post content for hide hack
- if ( t.responseJSON['post'] != "" )
- {
- // Editless attempt to reach the post content
- var postDivider = $( 'post_id_' + pid ).children[1].children[2].children[1];
- postDivider.innerHTML = t.responseJSON['post'];
- new Effect.Pulsate( postDivider, { duration: 1.5, pulses: 3 } );
- }
- new Effect.Pulsate( thankersBox, { pulses: 3, duration: 1.5 } );
- }
- }
- }
- );
- }
- </script>]]></template_content>
- <template_name>ajaxThanksJS</template_name>
- <template_data/>
- <template_updated>1311252744</template_updated>
- <template_removable>1</template_removable>
- <template_added_to>0</template_added_to>
- <template_user_added>1</template_user_added>
- <template_user_edited>1</template_user_edited>
- <template_master_key>root</template_master_key>
- <template_set_id>0</template_set_id>
- </templates>
- </hookextras_templates>
- <hookextras_css/>
- <hookextras_tasks/>
- <hookextras_database_create/>
- <hookextras_database_alter>
- <alter>
- <altertype>add</altertype>
- <table>profile_portal</table>
- <field>thanked</field>
- <newfield/>
- <fieldtype>int(10)</fieldtype>
- <default><![CDATA['0']]></default>
- </alter>
- <alter>
- <altertype>add</altertype>
- <table>posts</table>
- <field>thankers</field>
- <newfield/>
- <fieldtype>mediumtext</fieldtype>
- <default><![CDATA['']]></default>
- </alter>
- </hookextras_database_alter>
- <hookextras_database_update/>
- <hookextras_database_insert/>
- </hookexport>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement