View Full Version : characters hack in the title
all-the-vb
05-05-2003, 10:00 PM
Hello Everyone
hack : characters hack in the title .
hacked by All-the-vb
=========================
if a title is more than 40 characters long, what will be taken is only the first number of letters (depends on the number you select), this makes you thread subjects look neater...
example:
if a subject had a thread of 25 characters , you set it to display 14 characters only...
VB land forums.... <-- this is how it will show instead of VB land forums blah blah blah blah
all-the-vb
05-05-2003, 10:34 PM
screen 1 :
all-the-vb
05-05-2003, 10:34 PM
screen 2 :
ooh god ,
i just came to vb-hacks just to look around for somthing limit
thread title ... and i saw it in the last hack !!
thanx man , i loved ur hack and will be installed soon
regards
msu
all-the-vb
05-05-2003, 10:54 PM
You are welcome my friend,
sonic3d
05-05-2003, 10:56 PM
thanx. needed it. gj
l8er
sonic
Sulaiti
05-05-2003, 10:57 PM
Nice Hack
Good Work...
Will be Installing
Regards
colicab-d
05-05-2003, 11:06 PM
ooh handy me installs
Koutaru
05-06-2003, 12:31 AM
I'll install it too ^^; when I get some free time
Logik
05-06-2003, 01:47 AM
Nice little hack. but affective.
Boofo
05-06-2003, 04:07 AM
How many queries does this add to each thread title?
Boofo
05-06-2003, 04:34 AM
Here you go. This will do the same thing and you don't have to hack the db or worry about any extra queries.
//start characters length hack
$maxchars='60'; // thread title length
$thread[title]=unhtmlspecialchars($thread[title]);
if (strlen($thread[title]) > $maxchars) {
$thread[title] = substr($thread[title], 0, $maxchars-2) . '...';
}
//end characters length hack
ghroob
05-06-2003, 12:05 PM
very nice
tahnk you :)
mwhoob
05-06-2003, 12:11 PM
hi
good luck for you
and nice hack.
redstaing0
05-06-2003, 01:13 PM
Thankes
How ican unstaill it beusoe ihave install it for test and now iwant remove it
yxboom
05-06-2003, 07:08 PM
This hack doesn't work and I would like to uninstall it.
Boofo
05-06-2003, 07:15 PM
Today at 03:08 PM yxboom said this in Post #17 (https://vborg.vbsupport.ru/showthread.php?postid=392420#post392420)
This hack doesn't work and I would like to uninstall it.
If that doesn't work and you still want to be able to do it, use the code from this post. It works. I have been running it for a while now with no problems. ;)
https://vborg.vbsupport.ru/showthread.php?postid=392068#post392068
yxboom
05-06-2003, 07:18 PM
Boofo:
Thanks!
I install your code where the hack originally said to install in forumdisplay.php? And what about the inst.php file that I installed into the admin dir that is what I really want to get rid of cause I have this option in my admin panel and it is hard to understand...no offense to the author.
[edit to add] I would like to have the character limit around 30 characters. Where do I put this info?
Boofo
05-06-2003, 07:25 PM
Change the number (60) in this line to whatever you want it to be set at.
$maxchars='60'; // thread title length
Yes, put it in the same spot as his code. Let me know how it works for you. ;)
As far as removing the hack goes, go into your Admin CP and run settings.php (like this: http://yoursite.com/forum/admin/settings.php) and you should find the two areas to delete in there. It will take care of the queries needed to delete those.
yxboom
05-06-2003, 07:30 PM
Perfect!!! Thanks Boofo! You da man! ;)
[edit to add] Hrm.... I just typed in a 70 character title with no truncation :(
I am running v2.2.9
Boofo
05-06-2003, 07:49 PM
I'm running 2.2.9 also. Make sure you have the code I gave you right above this:
$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);
$thread[gotonew]='';
$thread[newoldhot]='folder';
if (!$thread[open]) {
$thread[newoldhot]='lock'.$thread[newoldhot];
}
all-the-vb
05-06-2003, 08:15 PM
Thanks for your replies
---------
Boofo
What is the problem? If there were codes working with
the data base?
you make it too huge :paranoid:
As you can see, the code I have put is
if(strlen($thread[title]) > $akbr){
$thread[title] = substr($thread[title],0,$small);
$thread[title] = "$thread[title] ...";
}
//end characters hack
you can change
$small
with
$akbr
With the numbers you want, and you brought a code from outside,
I don?t have a clue why!!
I have put it as the following
//start characters hack
$akbr=$DB_site->query("SELECT value FROM setting WHERE settingid=300");
$small=$DB_site->query("SELECT value FROM setting WHERE settingid=301");
if(strlen($thread[title]) > $akbr){
$thread[title] = substr($thread[title],0,$small);
$thread[title] = "$thread[title] ...";
}
//end characters hack
with the extra stuff, so the user will be able to use it from the control panel
and it doesn't need the file to be uploaded every time the number changes
all-the-vb
05-06-2003, 08:18 PM
yxboom
The hack is working perfectly
I don?t know why it didn't work with you
Do the following
Open
forumdisplay.php
find in line 609 :
if ($wordwrap!=0) {
$thread[title]=dowordwrap($thread[title]);
}
after that add :
//start characters hack
if(strlen($thread[title]) > 30){
$thread[title] = substr($thread[title],0,25);
$thread[title] = "$thread[title] ...";
}
//end characters hack
30 , 25
That is all, and it will work 100%
But you will not be able to control it from the control panel
Boofo
05-06-2003, 08:19 PM
There's no problem at all. But if I can save 2 queries for each thread just to get the length and set it, then I will go that route. I wasn't trying to infringe on your hack. I just offered an easier solution and avoided the queries.
all-the-vb
05-06-2003, 08:30 PM
no problem
thank for help
:)
yxboom
05-06-2003, 10:48 PM
Today at 01:49 PM Boofo said this in Post #22 (https://vborg.vbsupport.ru/showthread.php?postid=392446#post392446)
I'm running 2.2.9 also. Make sure you have the code I gave you right above this:
$thread[lastreplydate]=vbdate($dateformat,$thread[lastpost]);
$thread[lastreplytime]=vbdate($timeformat,$thread[lastpost]);
$thread[gotonew]='';
$thread[newoldhot]='folder';
if (!$thread[open]) {
$thread[newoldhot]='lock'.$thread[newoldhot];
}
Ok that works perfectly thanks a lot. Not to be inconsiderate or rude but being that I have installed Boofo's version of this hack I still need to know how to remove the options in the Admin panel cause apparently the settings.php isn't showing anything new. Thanks again.
marsauae
05-07-2003, 12:52 AM
????? ?????? :)
Koutaru
05-07-2003, 12:57 AM
go to your database in phpadmin and manually delete it
redstaing0
05-09-2003, 11:23 AM
05-07-03 at 02:57 AM Koutaru said this in Post #29 (https://vborg.vbsupport.ru/showthread.php?postid=392541#post392541)
go to your database in phpadmin and manually delete it
:confused: whats the db tabel name in the db imust delet it ?
yxboom
05-11-2003, 05:17 PM
good question reds...that is what Im trying to figure out
Boofo
05-11-2003, 05:29 PM
Go to your Admin CP and run the setting.php file and look for the lines in there and delete them. Simple. ;)
yxboom
05-11-2003, 05:33 PM
Seriously there are no lines. I looked 3 times after you had originally suggested this. Maybe Im just not looking right.
Boofo
05-11-2003, 05:36 PM
Look for this in the listing you get from the setting.php:
characters hack in the title
The settings to delete should be right there.
yxboom
05-11-2003, 05:40 PM
Ok I am a dufus!
You meant run it in the browser. I was looking for it via FTP in the file setting.php.
Sorry bro. Thanks a lot for your help. It is removed.
Boofo
05-11-2003, 05:41 PM
Did you run the inst.php file from the Admin CP when you installed the hack? If you did, then the settings are there. I don't have the hack installed so I can't tell you exactly where they are at.
yxboom
05-11-2003, 05:43 PM
When I ran admin/setting.php in my browser the character hack was at the bottom of the list. I removed it and it is all good now :)
Boofo
05-11-2003, 05:48 PM
Glad to hear that. In the future, remember the setting.php file. ;) I have a link to it in my Admin CP just for things like this. Makes things a lot easier. ;)
yxboom
05-11-2003, 05:49 PM
Im thinking Im gonna do just that ;)
insanctus
05-19-2003, 03:29 PM
~ Clicks install
Smoothie
06-02-2003, 06:37 AM
Hmm.... this only affects thread titles in forumdisplay. How about when searching for new posts? The thread title length is unchanged.
Boofo
06-02-2003, 07:04 AM
Just take the code I posted for this and apply it to the search.php. ;)
Smoothie
06-02-2003, 07:20 AM
wanna throw me a bone and tell me where to add it?
Boofo
06-02-2003, 08:07 AM
Smoothie, in search.php, try adding this:
//start characters length hack
$maxchars='30'; // thread title length
$searchresult[threadtitle]=unhtmlspecialchars($searchresult[threadtitle]);
if (strlen($searchresult[threadtitle]) > $maxchars) {
$searchresult[threadtitle] = substr($searchresult[threadtitle], 0, $maxchars-2) . '...';
}
//end characters length hack
AFTER this:
if ($wordwrap!=0) {
$searchresult[threadtitle]=dowordwrap($searchresult[threadtitle]);
}
and let me know if it works.
Smoothie
06-02-2003, 08:17 AM
yep, was just about to post I got it, then I saw your post. That does the trick.
Boofo
06-02-2003, 08:31 AM
I'm working on the forum title in the search.php as well as the private message titles in private.php, too.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.