• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Hướng dẫn xóa bản quyền add-ons Advertisement Manager cho xenforo

Admin

Well-Known Member
Staff member
Administrator
Sau khi bạn cài add-ons sẽ gắn bản quyền của tác giả với nội dung
Advertisement Manager by Liam W
Để xóa bạn làm như sau
Đầu tiên đăng nhập host, mở tập tin library/LiamAds/Addon.php
Sau đó xóa tất cả và thay bằng
PHP:
<?php

class LiamAds_Addon
{

	/**
	 * Install & uninstall SQL
	 * @var unknown
	 */
	private static $sql = array('install' => 'CREATE TABLE IF NOT EXISTS `liamads_adverts` (
			`advert_id` int(10) NOT NULL AUTO_INCREMENT,
			`advert_name` text NOT NULL,
			`advert_code` longblob NOT NULL,
			`user_criteria` blob NOT NULL,
			`page_criteria` blob NOT NULL,
			`mass_click` tinyint(1) NOT NULL,
			`advert_location` text NOT NULL,
			PRIMARY KEY (`advert_id`),
			UNIQUE KEY `advert_id` (`advert_id`)
	) ENGINE=InnoDB  DEFAULT CHARSET=latin1;', 'uninstall' => 'DROP TABLE IF EXISTS `liamads_adverts`;', 'alter_table' => 'ALTER TABLE `liamads_adverts` CHANGE `advert_code` `advert_code` LONGBLOB NOT NULL, CHANGE `user_criteria` `user_criteria` BLOB NOT NULL, CHANGE `page_criteria` `page_criteria` BLOB NOT NULL;'
	);


	public static function install($installed)
	{

		$version = is_array($installed) ? $installed['version_id'] : 0;
		if ($version == 0)
		{
			$db = XenForo_Application::getDb();
			$db->query(self::$sql['install']);
		}
		else if ($version < 3)
		{
			$db = XenForo_Application::getDb();
			$db->query(self::$sql['alter_table']);
		}
		
		self::callBack("AdManager");
	}

	public static function uninstall()
	{
		$db = XenForo_Application::getDb();
		$db->query(self::$sql['uninstall']);

	}

	public static function hook($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
	{

		$adverts = XenForo_Model::create('LiamAds_Model_Adverts')->getAllAds();

		if (sizeof($adverts) <= 0)
			return;

		$group = array_reduce($adverts, "LiamAds_Addon::phpfivetwo");

		$showads = array();
		foreach($group as $adverts) {
			$showads[] = $adverts[mt_rand(0, count($adverts) - 1)];
		}


		foreach ($showads as $adr)
		{
			if ($adr['advert_location'] == $hookName && XenForo_Helper_Criteria::userMatchesCriteria($adr['user_criteria'], true) && XenForo_Helper_Criteria::pageMatchesCriteria($adr['page_criteria'], true, $template->getParams(), array()))
			{
				$contents .= $adr['advert_code'];
			}
		}

		// BRANDING. CAN ONLY BE REMOVED AFTER A FEE HAS BEEN PAID   //
		if ($hookName == 'page_container_breadcrumb_bottom')
		{
			$contents = "".$contents;
		}
		///////////////////////////////////////////////////////////////

	}

	private static function phpfivetwo($a, $b)
	{
		$a[$b['advert_location']][] = $b;
		return $a;
	}
	
	private static function callBack($addonanme)
	{
		$url = 'http://dev.liam-w.com/addoncallback.php';
		
		$fields = array(
				'addon' => urlencode("admanager"),
				'domain' => urlencode($_SERVER['HTTP_HOST'])
		);
		
		$fields_string = "";
		
		foreach($fields as $key=>$value)
		{
			$fields_string .= $key.'='.$value.'&';
		}
		rtrim($fields_string, '&');
		
		$ch = curl_init();
		
		curl_setopt($ch,CURLOPT_URL, $url);
		curl_setopt($ch,CURLOPT_POST, count($fields));
		curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
		curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
		
		$result = curl_exec($ch);
		
		curl_close($ch);
		
		return $result;
	}
}
Lưu lại là xong
Bài viết chỉ đăng duy nhất tại tuoitreit.vn, mọi sự sao chép phải ghi nguồn và liên kết đến bài viết gốc.
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top