Advertisement

How to hide "index.php?tp=1" ???

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
User avatar
jnkk
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu May 07, 2009 6:36 am

How to hide "index.php?tp=1" ???

Post by jnkk » Sat Jul 04, 2009 3:07 pm

Hello,

Requesting help on how to remove or hide "tp=1". I do not wish to view the template in the frontend of the website. So far, its the only indication to let people know I'm using joomla. I want to hide/remove to disable the feature.

Is there a way?

Please help. Thanks. Been searching thru the search and threads.. the search doesn't enable me to search for keyword "tp=1" as it recognise as tp 1. And have scanned thru almost 100 post out of 300+.

Thank you.

Advertisement
User avatar
Stroganoff
Joomla! Guru
Joomla! Guru
Posts: 677
Joined: Fri Jun 26, 2009 11:05 pm

Re: How to hide "index.php?tp=1" ???

Post by Stroganoff » Sat Jul 04, 2009 3:13 pm

This variable is only for template preview, it shouldn't be in your URLs all the time. Tell us more about your template configuration.

User avatar
jnkk
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu May 07, 2009 6:36 am

Re: How to hide "index.php?tp=1" ???

Post by jnkk » Sat Jul 04, 2009 3:26 pm

the setting is done under template configuration? If I'm using the default rhuk_milkyway template; I have to configure in the index.php? Its not something found in the includes folder?

I found this post during a search http://forum.joomla.org/viewtopic.php?f=236&t=293789 but unfortunately, its for joomla 1.0 only. Need for joomla 1.5.
A newbie learning the ropes
====================
http://quackphotos.[URL banned].com
http://www.completeasia.com

User avatar
Stroganoff
Joomla! Guru
Joomla! Guru
Posts: 677
Joined: Fri Jun 26, 2009 11:05 pm

Re: How to hide "index.php?tp=1" ???

Post by Stroganoff » Sat Jul 04, 2009 3:33 pm

I still don't read you. Have you set your desired template to default (big yellow start) in the template manager?

User avatar
jnkk
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu May 07, 2009 6:36 am

Re: How to hide "index.php?tp=1" ???

Post by jnkk » Sat Jul 04, 2009 3:36 pm

yes of course. the RHUK Milkyway template is set as default template. I'm trying to disable the frontend so that people cannot view the template when they type in my url/index.php?tp=1
A newbie learning the ropes
====================
http://quackphotos.[URL banned].com
http://www.completeasia.com

User avatar
Stroganoff
Joomla! Guru
Joomla! Guru
Posts: 677
Joined: Fri Jun 26, 2009 11:05 pm

Re: How to hide "index.php?tp=1" ???

Post by Stroganoff » Sat Jul 04, 2009 3:45 pm

But who would want to manually type "tp=1" into the URL just to find out you're using Joomla? A simple look at the source code should reveal that anyway.

User avatar
EivindJ
Joomla! Explorer
Joomla! Explorer
Posts: 411
Joined: Mon Nov 17, 2008 12:16 pm
Location: Drammen
Contact:

Re: How to hide "index.php?tp=1" ???

Post by EivindJ » Tue Oct 13, 2009 10:41 am

If anyone still are wondering:

Add the following to your .htaccess file:

##### Start ?tp=1 prevention ######
RewriteCond %{QUERY_STRING} tp=(.*)
RewriteRule ^(.*)$ index.php [F,L]
##### End ?tp=1 prevention ######
Trond Eivind Johnsen

[ lei en Joomla!-ekspert på www.exentra.no ]

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 28299
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: How to hide "index.php?tp=1" ???

Post by imanickam » Tue Apr 27, 2010 6:45 am

You could try the extension Module Position Ban (http://extensions.joomla.org/extensions ... ating/5064).
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged

ah010223
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Fri May 07, 2010 9:16 am
Location: Dhaka

Re: How to hide "index.php?tp=1" ???

Post by ah010223 » Fri May 07, 2010 9:48 am

Hello,
I want to prevent tp=1 by changing any code in joomla 1.5. No htaccess or plugins.Please help me. Thanks in advance.
Alan

User avatar
himanshu981
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 197
Joined: Sat May 23, 2009 5:37 pm
Location: India
Contact:

Re: How to hide "index.php?tp=1" ???

Post by himanshu981 » Fri May 07, 2010 10:32 am

Hi

Try this...

Open the below file any php editor

/libraries/joomla/application/module/helper.php

Go to line number 96-101 seems like this

Code: Select all

		if(count($result) == 0) {
			if(JRequest::getBool('tp')) {
				$result[0] = JModuleHelper::getModule( 'mod_'.$position );
				$result[0]->title = $position;
				$result[0]->content = $position;
				$result[0]->position = $position;
Replace by this code:

Code: Select all

		if(count($result) == 0) {
			if(JRequest::getBool('tp')) {
				//$result[0] = JModuleHelper::getModule( 'mod_'.$position );
				//$result[0]->title = $position;
				//$result[0]->content = $position;
				//$result[0]->position = $position;
Then in same file go to line no 200 seems like this

Code: Select all

		//dynamically add outline style
		if(JRequest::getBool('tp')) {
			$attribs['style'] .= ' outline';
Replace with this

Code: Select all

		//dynamically add outline style
		if(JRequest::getBool('tp')) {
			//$attribs['style'] .= ' outline';
It should work. I am doing like this.

BUT keep in mind when you will upgrade Joomla version, it will be no more working.

Regards
"My life goes with Joomla!"
Joomla Design Masters

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12813
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: How to hide "index.php?tp=1" ???

Post by brian » Fri May 07, 2010 11:46 am

Much easier and safer to make the change in htaccess as described above
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

ah010223
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Fri May 07, 2010 9:16 am
Location: Dhaka

Re: How to hide "index.php?tp=1" ???

Post by ah010223 » Fri May 07, 2010 1:45 pm

Thanks himanshu981. It really works.

Dear brian! I added those code to htaccess, but that did not work for me. Would you please give me more direction to work it perfectly?

Thanks in advance.
Alan

User avatar
C0nw0nk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 248
Joined: Tue Jun 15, 2010 1:12 am
Location: United Kingdom, London
Contact:

Re: How to hide "index.php?tp=1" ???

Post by C0nw0nk » Fri Jul 02, 2010 3:50 pm

this method works wounderfully thanks :D

krems04
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Jan 05, 2009 4:45 pm

Re: How to hide "index.php?tp=1" ???

Post by krems04 » Tue Jul 13, 2010 5:30 pm

adding

Code: Select all

JRequest::setVar('tp',0);
in a php block to the top of your template's index.php works beautifully too


as seen here http://blog.joomlaworks.gr/properly-pre ... ites-using

User avatar
PosIKLAN
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 138
Joined: Sat Jul 10, 2010 6:08 pm
Location: Jakarta
Contact:

Re: How to hide "index.php?tp=1" ???

Post by PosIKLAN » Tue Jul 13, 2010 5:36 pm

Stroganoff wrote:...A simple look at the source code should reveal that anyway.
Ouch... :)

Or:
type yoursite.com/administrator
My Online Store:
Toko Online http://toko.posiklan.com

tomytran
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 244
Joined: Mon Dec 14, 2009 1:52 pm
Contact:

Re: How to hide "index.php?tp=1" ???

Post by tomytran » Tue Aug 31, 2010 5:12 am

krems04 wrote:adding

Code: Select all

JRequest::setVar('tp',0);
in a php block to the top of your template's index.php works beautifully too

as seen here http://blog.joomlaworks.gr/properly-pre ... ites-using
I like this method, it's pretty solution. But think further in solution, add some codes to allow your user can see it but guest can not ;)

Good luck!
https://toha.us/app - a demo forum [ Simple Machine Forum ]

User avatar
yop
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Sep 21, 2008 6:47 pm
Location: Jakarta, Indonesia
Contact:

Re: How to hide "index.php?tp=1" ???

Post by yop » Thu Nov 04, 2010 7:00 pm

seems that i have the oppposite problems, i can't figure out why i can't see my module position by adding index.php?tp=1, i really need this...
Please read forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?t=65

SpiceVita
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Oct 28, 2010 1:01 pm

Re: How to hide "index.php?tp=1" ???

Post by SpiceVita » Sun Nov 14, 2010 10:20 pm

@yop do you have a custom theme? Except of this I don't see why you couldn't preview your template...
Professional PHP/C++ Programmer: If you need help, PM me.
http://vitavee.com/forums/
http://www.euserreviews.com/

User avatar
rcdahal
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Tue Jun 07, 2011 3:14 am
Location: The Country Of MT-Everest
Contact:

Re: How to hide "index.php?tp=1" ???

Post by rcdahal » Fri Jun 24, 2011 7:43 am

In Joomla generally We can Find the Module Positions by typing domain.com/folder/?tp=1 on browsers.We Need to Hide The Module Positions On Joomla Tempelates.There Are many ways to hide Disable The ?tp=1 Command On Joomla eg Using joomla .htaccess

##### Start ?tp=1 prevention ######
RewriteCond %{QUERY_STRING} tp=(.*)
RewriteRule ^(.*)$ index.php [F,L]
##### End ?tp=1 prevention ######

abut You Need To change htaccess.txt to .htaccess

Another Ways(Core Hack)

Go to /libraries/joomla/application/module/helper.php and look around line 200 for this code.

//dynamically add outline style
if(JRequest::getBool('tp')) {
$attribs['style'] .= ' outline';
}

Comment out the 3rd line out with //

//dynamically add outline style
if(JRequest::getBool('tp')) {
//$attribs['style'] .= ' outline';
}
Last edited by ooffick on Fri Jun 24, 2011 11:25 am, edited 1 time in total.
Reason: Mod Note: Removed URL to own domain. Self Promotion is not allowed! Please read the Forum rules for details.

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12813
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: How to hide "index.php?tp=1" ???

Post by brian » Sat Nov 19, 2011 9:58 am

NEVER use the core hack method recommended above as that will be removed whenever you do an update
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/

Advertisement

Locked

Return to “Templates for Joomla! 1.5”