Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2007, 07:39 PM
dgeere dgeere is offline
 
Join Date: Nov 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default See 5 photos and then have to register

Hey all. There is a plugin on here that lets guests view 5 THREADS and then have to register to see more.

I wonder if someone can help me change it so that instead of threads it will let guests see 5 IMAGES in my photopost galleries before they have to register.

The code of the plugin is as follows but I have no clue what to change to make it note the number of image views into the cookie instead of the number of thread views.

Any help is REALLY appreciated. Cheers!

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>



<product productid="limited_guest_viewing" active="1">
	<title>Limited Guest Viewing</title>
	<description>Limit guests to view a set number of threads before being locked out.</description>
	<version>1.0.6</version>

	<url>http://www.moderninsider.com/forums/forumdisplay.php?f=13</url>

	<versioncheckurl />

	<dependencies>

		<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="" />

	</dependencies>

	<codes>

	</codes>

 	<templates>

 		<template name="limited_guest_viewing" templatetype="template" date="0" username="Ted S" version="1.0.5"><![CDATA[

			<!-- LGV :: Register Take-Over Message  -->			

			<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

			<tr>

				<td class="alt1">

					<phrase 1="$vboptions[bbtitle]" 2="$vboptions[bburl]">$vbphrase[lgvmess]</phrase>

				</td>

			</tr>

			</table>

			<br />

			<!-- / LGV :: Register Take-Over Message --> 		

 		]]></template>

	</templates>

	<plugins>

		<plugin active="1">

			<title><![CDATA[LGV System [Template Cache]]]></title>

			<hookname>cache_templates</hookname>

			<phpcode><![CDATA[

				$globaltemplates[] = 'limited_guest_viewing';

			]]></phpcode>

		</plugin>

		<plugin active="1">

			<title><![CDATA[LGV System [Thread Check]]]></title>

			<hookname>showthread_getinfo</hookname>

			<phpcode><![CDATA[

			($hook = vBulletinHook::fetch_hook('lgv_plugin')) ? eval($hook) : false;

			]]></phpcode>

		</plugin>

		<plugin active="1">

			<title><![CDATA[LGV System [View Post Check]]]></title>

			<hookname>showpost_start</hookname>

			<phpcode><![CDATA[

			($hook = vBulletinHook::fetch_hook('lgv_plugin')) ? eval($hook) : false;

			]]></phpcode>

		</plugin>

		<plugin active="1">

			<title><![CDATA[LGV System [Print Thread Check]]]></title>

			<hookname>printthread_start</hookname>

			<phpcode><![CDATA[

			($hook = vBulletinHook::fetch_hook('lgv_plugin')) ? eval($hook) : false;

			]]></phpcode>

		</plugin>

		<plugin active="1">

			<title><![CDATA[LGV System [Processing Routine]]]></title>

			<hookname>lgv_plugin</hookname>

			<phpcode><![CDATA[

			// check if user is a bot

			$lvgbot = ($vbulletin->superglobal_size['_COOKIE'] == 0 AND preg_match("#(google|msnbot|zoints|aol|yahoo|slurp)#si", $_SERVER['HTTP_USER_AGENT']));

						

			// check if user is a guest and if system is enabled				

			if ($show['guest'] AND !$lvgbot AND $vbulletin->options['lgvon'])

			{

				

				// update guest view counter cookie

				$lgv = $vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'userlgv', TYPE_UINT);

				$lgv++;

				vbsetcookie('userlgv', $lgv);

				

				// build array of excluded forums

				if (trim($vbulletin->options['lgvforumids']) != '')

				{

					$lgvforumids = preg_split('#\s+#s', $vbulletin->options['lgvforumids'], -1, PREG_SPLIT_NO_EMPTY);

				} else { $lgvforumids = Array('0'); }

				

				// check if requested forum is exluded

				if(!in_array($thread['forumid'],$lgvforumids) AND !in_array($threadinfo['forumid'],$lgvforumids))

				{

	

					// check if message option is on and if user qualifies

					if ($vbulletin->options['lgvmesson'] AND $lgv > $vbulletin->options['lgvmesscnt'] AND $lgv <= $vbulletin->options['lgvblckcnt']) 

					{

					

						//eval(standard_error(fetch_error('lgvmess',$lgv,$vbulletin->options['lgvcnt'])));

						eval('$lgvmessage = "' . fetch_template('limited_guest_viewing') . '";');

					

					// check block option is on and user qualifies

					}	else if ($vbulletin->options['lgvblckon'] AND $lgv > $vbulletin->options['lgvblckcnt']) {						

							

						eval(standard_error(fetch_error('lgvblck',$vbulletin->options['bbtitle'],$vbulletin->options['bburl'])));

					

					}

				

				}

				

			}				

			]]></phpcode>

		</plugin>		

	</plugins>

	<phrases>

		<phrasetype name="error" fieldname="error">

			<phrase name="lgvblck" date="0" username="Ted S" version="1.0.6"><![CDATA[Hey there!<br \><br \>It appears that you've exceeded the maximum number of posts you can view, but wait, there's a simple solution. To unlock the forum and continue viewing messages, all you need to do is <a href="{2}/register.php">sign up</a> for a free account. The entire process takes just a few minutes so <a href="{2}/register.php">create your account now</a> and view as many threads as you like!<br \><br \>Already a member? Login at the top of this page to stop seeing this message.]]></phrase>

		</phrasetype>

		<phrasetype name="global" fieldname="global">

			<phrase name="lgvmess" date="0" username="Ted S" version="1.0.5"><![CDATA[Hey there!<br /><br />It looks like you're enjoying {1} but haven't created an account yet. Why not take a minute to <a href="{2}/register.php">register</a> for your own free account now? As a member you get free access to all of our forums and posts plus the ability to post your own messages, communicate directly with other members and much more. <a href="{2}/register.php">Register now!</a><br /><br />Already a member? Login at the top of this page to stop seeing this message. ]]></phrase>

		</phrasetype>

		<phrasetype name="vBulletin Settings" fieldname="vbsettings">

			<phrase name="setting_lgvon_desc" date="0" username="Ted S" version="1.0.5"><![CDATA[This option allows you to enable or disable the Guest Limited Viewing System.]]></phrase>

			<phrase name="setting_lgvon_title" date="0" username="Ted S" version="1.0.5"><![CDATA[Enable Limited Guest Viewing]]></phrase>

			<phrase name="setting_lgvmesson_desc" date="0" username="Ted S" version="1.0.5"><![CDATA[This option allows you to enable or disable the Register Take-Over Message. When enabled, guests will see a message above the posts prompting them to register after they have viewed as many threads as you specify.]]></phrase>

			<phrase name="setting_lgvmesson_title" date="0" username="Ted S" version="1.0.5"><![CDATA[Enable Register Take-Over Message]]></phrase>

			<phrase name="setting_lgvmesscnt_desc" date="0" username="Ted S" version="1.0.5"><![CDATA[This option allows you to set the number of threads/ posts a guest may view before receiving seeing the Register Take-Over Message.<br /><br />To edit the phrase for this message error, <a href="./phrase.php?do=edit&e[global][lgvmess]">click here</a> (enter your custom text in the translation box).]]></phrase>

			<phrase name="setting_lgvmesscnt_title" date="0" username="Ted S" version="1.0.5"><![CDATA[Register Take-Over Message Count]]></phrase>

			<phrase name="setting_lgvblckon_desc" date="0" username="Ted S" version="1.0.5"><![CDATA[This option allows you to enable or disable the Register Block Page. When enabled, guests will see a message above the posts prompting them to register after they have viewed as many threads as you specify.]]></phrase>

			<phrase name="setting_lgvblckon_title" date="0" username="Ted S" version="1.0.5"><![CDATA[Enable Register Block Page]]></phrase>

			<phrase name="setting_lgvblckcnt_desc" date="0" username="Ted S" version="1.0.5"><![CDATA[This option allows you to set the number of threads/ posts a guest may view before receiving the error message. If you are using the Register Take-Over Message, this setting should be set higher.<br /><br />To edit the phrase for this message error, <a href="./phrase.php?do=edit&e[error][lgvblck]">click here</a> (enter your custom text in the translation box).]]></phrase>

			<phrase name="setting_lgvblckcnt_title" date="0" username="Ted S" version="1.0.5"><![CDATA[Register Block Page Count]]></phrase>

			<phrase name="setting_lgvforumids_desc" date="0" username="Ted S" version="1.0.5"><![CDATA[This option allows you to exclude forums from the guest viewing limit. For example, you can enable guests to view threads in your announcements or support forums even if they have already exceeded their viewing allotment.<br /><br />Enter a list of forum ids, separated by spaces (for example: 4 9 27 42).]]></phrase>

			<phrase name="setting_lgvforumids_title" date="0" username="Ted S" version="1.0.5"><![CDATA[Excluded Forum Ids]]></phrase>

			<phrase name="settinggroup_lgvgroup" date="0" username="Ted S" version="1.0.5"><![CDATA[Limited Guest Viewing System]]></phrase>

		</phrasetype>

	</phrases>

	<options>

		<settinggroup name="lgvgroup" displayorder="1001">

			<setting varname="lgvon" displayorder="10">

				<datatype>boolean</datatype>

				<optioncode>yesno</optioncode>

				<defaultvalue>0</defaultvalue>

			</setting>

			<setting varname="lgvmesson" displayorder="20">

				<datatype>boolean</datatype>

				<optioncode>yesno</optioncode>

				<defaultvalue>0</defaultvalue>

			</setting>

			<setting varname="lgvmesscnt" displayorder="30">

				<datatype>number</datatype>

				<defaultvalue>5</defaultvalue>

			</setting>

			<setting varname="lgvblckon" displayorder="40">

				<datatype>boolean</datatype>

				<optioncode>yesno</optioncode>

				<defaultvalue>0</defaultvalue>

			</setting>

			<setting varname="lgvblckcnt" displayorder="50">

				<datatype>number</datatype>

				<defaultvalue>10</defaultvalue>

			</setting>

			<setting varname="lgvforumids" displayorder="60">

				<datatype>text</datatype>

				<defaultvalue>0</defaultvalue>

			</setting>	

		</settinggroup>

	</options>

	<helptopics>

	</helptopics>

	<cronentries>

	</cronentries>

	<faqentries>

	</faqentries>

</product>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03667 seconds
  • Memory Usage 2,208KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete