Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-06-10 02:03:58
- tommelee
- Member
- Registered: 2006-06-10
- Posts: 10
CMS convert, little help with...basics?
Hey folks, I’m new here. I’m converting over from Mambo/Joomla for a new blog site.
I have a couple quick issues, hoping someone could help me…1:
I’d like to post static content @ the top of the page. I understand I could…create a new form and use a special div…or…I found this:
http://textpattern.com/faq/84/how-do-i-keep-a-post-at-the-top-of-the-page
but where do I put that code? Into an article? Into the form? Also, where do I get the ID number for an article? It’s there for files, but I don’t see it for articles?
Also, I have some files I’d like to make downloadable (got that part figured out), but leeching/hotlinking will be a problem. I’ve turned on hotlink protection on the server, but because the php calls for the d/l, it’s allowing it. Is there any easy way to prevent leeching?
I’m also going to try integrating adsense, but I found a great post on how to do that, so I’ll try it before I ask any questions. Anyways, thanks in advance!!
Offline
#2 2006-06-10 02:44:50
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: CMS convert, little help with...basics?
..where do I put that code? Into an article? Into the form?
Into your page. Thanks for checking the FAQ first, by the way. :)
Also, where do I get the ID number for an article? It’s there for files, but I don’t see it for articles?
An oversight. This has been fixed in svn so will be available in the next maintenance release.
In the meantime, you can find an article’s id# by going to the “articles” tab, and hover your mouse over the article link. In your statusbar you should be able to see your article’s id: ...step=edit&ID=1
Offline
#3 2006-06-10 04:29:02
- tommelee
- Member
- Registered: 2006-06-10
- Posts: 10
Re: CMS convert, little help with...basics?
Ahh, rgr that. Fixt.
And…goofy me, I didn’t even THINK about checking the status bar. Dumb dumb dumb. Thanks!
Any ideas on anti-leech? Even a quick and dirty?
Thanks again!
Offline
#4 2006-06-10 04:53:25
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: CMS convert, little help with...basics?
You need to make sure the hotlink protection is for any url like “/file_download/”.
You can try and do it by hand by tinkering with the .htaccess file yourself, like the example here. If you’re not familiar with .htaccess, let us know:
- Your site url
- What url you want to send hotlinkers to
and someone can give you the specific code to try. :)
Offline
#5 2006-06-10 05:17:34
- tommelee
- Member
- Registered: 2006-06-10
- Posts: 10
Re: CMS convert, little help with...basics?
Ahhh…nice. The only server-controlled hotlink protection I have is from cpanel, and it doesn’t help me because the file’s being called from the php, so it gets permission.
Here’s my ugly site. Someone else’s template for now, like I did for joomla/mambo I wanted to learn how the templates work before I really try something unique.
www.plucky.org
And here’s the hotlink page: www.plucky.org/gank.txt
Looks to me like adding this to my .htaccess would work:
RewriteEngine On
#RewriteCond %{HTTP_REFERER} !^$ [OR]
RewriteCond %{HTTP_REFERER} !^http://(www.)?(plucky.org)/.*$ [NC]
RewriteRule ^file_download/(.*)?$ http://www.plucky.org/gank.txt [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
Although, I’m not inherently against someone viewing my articles…I just churn out lots of tutorials in pdf form, and I don’t want other people hotlinking them. I guess I could edit the third line down to something like this? I suck @ switches.:
RewriteCond %{HTTP_REFERER} !^http://(www.)?(plucky.org)/.pdf, .exe, .zip, .jpg$ [NC]
Offline
#6 2006-06-10 07:13:46
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: CMS convert, little help with...basics?
I guess I could edit the third line down to something like this?
Afraid not, since the extension isn’t getting directly requested from the server, which is why your server hotlink protection wasn’t working.
deleted
:)
Last edited by Mary (2006-06-11 03:25:44)
Offline
#7 2006-06-10 14:08:21
- tommelee
- Member
- Registered: 2006-06-10
- Posts: 10
Re: CMS convert, little help with...basics?
Ack! I edited your post by mistake, instead of hitting reply! So sorry. I’m in top form today…
Again, sorry. -Mary
Last edited by Mary (2006-06-10 21:50:35)
Offline
#8 2006-06-10 21:49:58
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: CMS convert, little help with...basics?
Hrm…well, still not working. Here is exactly what I have in my entire .htaccess. I took OUT the old rewrite condition for the server default hotlink protection. Should I not have?
Actually, you’ve got the one rule in there first, so the server’s not getting to the hotlink protection bit. I also had the wrong clean urls bit in there, I had grabbed from that article example but I should have remembered he wasn’t using the shipped rules. Okay, try this:
deleted
:)
Last edited by Mary (2006-06-11 03:25:58)
Offline
#9 2006-06-11 02:41:01
- tommelee
- Member
- Registered: 2006-06-10
- Posts: 10
Re: CMS convert, little help with...basics?
Holy bajeebus.
Ok, well, after killing and fixing the template about 100 times, this is the product:
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
<IfModule mod_rewrite.c>
#Textpattern hotlink protection
#This needs to come before the general Txp rewrite rules
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?plucky\.org(/)?.*$ [NC]
RewriteRule ^file_download/(.*)$ http://www.plucky.org/gank.txt [R,NC]
#Textpattern clean urls
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
#php_value register_globals 0
Problem…it’s now returning a 404 error for external AND internal links to the file. Thanks for being so persistent, I feel like we’re building a ramp to the short bus here.
Offline
#10 2006-06-11 03:25:10
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: CMS convert, little help with...basics?
Okay, it looks like your server doesn’t support clean urls: this works but this doesn’t. That makes things tricker…
DirectoryIndex index.php index.html
#Options +FollowSymLinks
RewriteEngine On
#RewriteBase /relative/web/path/
#Textpattern hotlink protection
#This needs to come before the general Txp rewrite rules
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?plucky\.org(/)?.*$ [NC]
RewriteRule s=file_download http://www.plucky.org/gank.txt [R,NC]
#Textpattern clean urls
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) [PT,L]
RewriteRule ^(.*) index.php
#php_value register_globals 0
Offline
#11 2006-06-11 03:44:07
- tommelee
- Member
- Registered: 2006-06-10
- Posts: 10
Re: CMS convert, little help with...basics?
Well, now I’m pretty much lost, haha.
I copied exactly what you have there, and the template went away. The only way the template DOESN’T go away is if I leave the <ifmodule> in place. This is exactly what I have now, please note that I still get a 404 on the internal download. Also, what tag are you using to highlight the code? I’m used to {code} and {quote}…
DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
<IfModule mod_rewrite.c>
#Textpattern hotlink protection
#This needs to come before the general Txp rewrite rules
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?plucky\.org(/)?.*$ [NC]
RewriteRule s=file_download http://www.plucky.org/gank.txt [R,NC]
#Textpattern clean urls
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
#php_value register_globals 0
Offline
#12 2006-06-11 05:01:03
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: CMS convert, little help with...basics?
…the template went away. The only way the template DOESN’T go away is if I leave the in place.
I don’t understand.
Offline