Version: 1.00, by TWTCommish
Developer Last Online: Dec 2022
Version: 2.2.x
Rating:
Released: 02-26-2002
Last Update: Never
Installs: 6
No support by the author.
Alright, first off, this hack will probably only be of use to those who edit their templates with any kind of regularity. It's useful to me, so I figured it might be useful to others who like to tweak their templates and such constantly as well.
What's it do?
It tracks the number of times you've edited each of your templates. It also tracks the time of the last edit, and displays the top ten most edited templates on your CP home page. I find this saves a lot of time in template editing, as, otherwise, you've got to scroll to the bottom of the left-hand frame...besides; the templates you're always going back to will be the ones right there near the top anyway.
How do I install it?
Follow the instructions in the attached text file. It entails two very short queries to be run on your forums DB, And a couple of modifications in just two files. The whole thing should only take a few minutes.
Enjoy.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Is there any way to make this so that the listing is in alphabetical order like the main listing? The ones I edit alot are really spread out and it would be easier to go right to the one in the list the same way you do in the main listing.
I know this is an old hack, but I'd like to try and get it working for me in 2.34 - I can't seem to get it to keep track of the number of times edited - the edits and last edited fields always remain at 0.
This is the code I'm using for the update at the moment:
Code:
$DB_site->query("UPDATE template SET templatesetid=$templatesetid,title='$title',template='$template',edits = edits + 1,lastedit=time() WHERE templateid=$templateid");
I know this is an old hack, but I'd like to try and get it working for me in 2.34 - I can't seem to get it to keep track of the number of times edited - the edits and last edited fields always remain at 0.
This is the code I'm using for the update at the moment:
Code:
$DB_site->query("UPDATE template SET templatesetid=$templatesetid,title='$title',template='$template',edits = edits + 1,lastedit=time() WHERE templateid=$templateid");
Any suggestions? Thanks!
Here's what I was using on vB2 and it worked great for me. It looks almost exactly the same but there is a slight difference. Try it and let me know if it helps.
Code:
$DB_site->query("UPDATE template SET templatesetid=$templatesetid,title='".addslashes("$title")."',template='".addslashes("$template")."',edits = edits + 1, lastedit='".time()."' WHERE templateid=$templateid");
Hmm...doesn't seem to be working. Though somehow I have one template listed now correctly, but I can't get any others to work or that one to register more edits.
So I'm not sure if what I had before somehow worked briefly, or if when I changed to your code it briefly displayed correctly. But I can't replicate it using either my or your code. Weird!
If you want, I can send you the code I used for this. It is a little different but better than the original hack. I added some features that I use quite a bit. If you're interestd, pm me and I'll get it to you.