Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > HTML / XHTML
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 02-19-2013, 06:56 AM
  #1
James909
Soldier (Level 11)
 
Join Date: Aug 2011
Posts: 149
iTrader: (0)
James909 is an unknown quantity at this point
Making code only run on certain URLs

Hello everyone,

I have a wiki site that i have added a facebook comment into its 'skin' code, using the following code:

Code:
	<!-- /debughtml -->
</div>
<br />
<center><div class="fb-comments" data-width="800" data-num-posts="100" data-colorscheme="dark"></div></center>
    <!-- /bodyContent -->
The facebook comment box appears on every page, including the main page, edit pages, etc. which i dont want

I would like the code to appear on page URL's for example
http://itswikimy.com/index.php?title=Page-Name-Here

but not on the page history URL, such as
http:///itswikimy.com/index.php?titl...action=history

and not on the page edit URL, such as
http://itswikimy.com/index.php?title...re&action=edit

i also dont want the facebook comment code running on these main pages
http://itswikimy.com/index.php?title=Main_Page
http://itswikimy.com/index.php?title...mmunity_portal
http://itswikimy.com/index.php?title...Current_events

Does anyone know the code for only adding the facebook comment to certain URLs and not other URLs, i have googled to no avail

thanks, James
James909 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-19-2013, 09:19 AM
  #2
James909
Soldier (Level 11)
 
Join Date: Aug 2011
Posts: 149
iTrader: (0)
James909 is an unknown quantity at this point
After doing some research, i have made this if, else code

Code:
				<!-- /debughtml -->
			</div>
            <br />
            <?php
if (isset($_GET['title']) && $_GET['title'] == 'Main_Page,Community_portal,Current_events,Special:RecentChanges,Help:Contents,Special:WhatLinksHere/Help:Contents,Special:Upload,Special:SpecialPages,itsmywiki.com:Privacy_policy,itsmywiki.com:About,Wiki-DJ.com:General_disclaimer,Special:Preferences,Special:Watchlist,Special:Contributions/itsmywiki.com,Special:UserLogout&returnto=Special%3AContributions%2F$,User:$,User_talk:$') {
    // do nothing
} else {
    if (isset($_GET['action']) && $_GET['action'] == 'edit,history') {
    // do nothing
    } else { ?>
    <center><div class="fb-comments" data-width="800" data-num-posts="100" data-colorscheme="dark"></div></center>
<?php } ?>
			<!-- /bodyContent -->
but it is causing a syntax error further down in the page code
James909 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 10:34 AM.

   

Mascot team created by Drawshop.com | Web Hosting

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.