View Full Version : Req: User decides post direction
TundraSoul
10-18-2002, 06:33 PM
Users continue to request the ability to choose which direction the forum threads are displayed, forward or reverse.
No matter what direction I set it in the control panel, I end up only pleasing half the group. Could someone please create a hack to add this feature? Perhaps as an option in the user control panel?
Thanks!
Logician
10-18-2002, 07:47 PM
Easiest way:
Create a new user profile field editable by user and ask your users to enter "1" if they want normal order and "0" if they want reverse. (If you want you can hack register.php and member.php to show this profile field as a "radio button" or "check box")
Then edit showthread.php, find:
$posts=$DB_site->query("
Before that add:
if ($bbuserinfo[fieldX]==0) {$postorder='DESC';}
else {$postorder='ASC';}
Replace X with the id of your profile field
That's it.. :)
TundraSoul
10-18-2002, 08:09 PM
Thanks I'll give that a try, and let you know how it turns out.
I was wondering though, what if the user hasn't filled out the new field, and it's simply blank? Will showthread choke on the empty field?
Logician
10-18-2002, 08:23 PM
Originally posted by TundraSoul
Thanks I'll give that a try, and let you know how it turns out.
I was wondering though, what if the user hasn't filled out the new field, and it's simply blank? Will showthread choke on the empty field?
No it will not.. It will be automatically either one even if the field is empty
TundraSoul
10-18-2002, 09:12 PM
.
TundraSoul
10-18-2002, 09:32 PM
Okay, good news, VB came to its senses and realized the extra column wasn't there.
Lets leave the database alone if we can. Any other suggestions?
Logician
10-18-2002, 09:50 PM
If you want a user selectable option, how can u leave db alone? You have to save the user's selection somewhere in your database. You would consider adding a new field to user table if you didnt apply my solution and it would require much more hacking since you need to form a interface for your users to populate this field. Adding a new profile field just saves you from this trouble.
Bottom line is, you can not have such a hack without touching your db.
TundraSoul
10-18-2002, 09:57 PM
.
TundraSoul
10-18-2002, 10:09 PM
.
Logician
10-18-2002, 10:09 PM
1- Creating a new user profile field is done inside Admin CP. I hope you first this method in the first place? It would be very unnecessary to use PhPmyadmin to add a new profile field.
If you created the field via Admin CP, I doubt it would give you this problem. It should not be server intensive to create a new user profile field even if your db is large.
2- Messing with db with PhpMyadmin is not recommended unless you know what you are doing. But if you are intended a new profile field has 2 traces in your db. Its name and options are recorded in "profilefield" table where one new column is also added to "userfield" table. Deleting its record from profilefield and deleting the column from userfield, should solve the problem IF IT IS RELATED to profile fields. (BACKUP DB!) But as I said before I doubt it, it might be another db problem you are having at the moment..
Logician
10-18-2002, 10:11 PM
Originally posted by TundraSoul
Well I'm screwed.
The good 'ole VB database error.
Database error in vBulletin 2.2.7:
Invalid SQL: SELECT user.*,userfield.* FROM user LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='10938' mysql error: Can't open file: 'userfield.MYD'. (errno: 145)
mysql error number: 1016
Time for a SQL restore... ?
Try "repair user" first.. Also try repairing other related tables before taking further steps.. It's sounds like a trivial db corruption, repair should fix it..
TundraSoul
10-18-2002, 10:17 PM
I should use VB's repair.php in the admin directory?
Originally posted by Logician
Try "repair user" first.. Also try repairing other related tables before taking further steps.. It's sounds like a trivial db corruption, repair should fix it..
TundraSoul
10-18-2002, 10:18 PM
What repair do you mean?
NTLDR
10-18-2002, 10:20 PM
Originally posted by TundraSoul
What repair do you mean?
repair.php is found in the extras folder of your vBulletin Zip file, upload it to your forum/admin directory and run from your browser :)
TundraSoul
10-18-2002, 10:23 PM
Thanks, I found it, and did, but it was of little help.
I got the same error when running it.
There seems to have been a slight problem with the Tundra Solutions database.
Please try again by pressing the refresh button in your browser.
An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.
We apologise for any inconvenience.
Originally posted by NTLDR
repair.php is found in the extras folder of your vBulletin Zip file, upload it to your forum/admin directory and run from your browser :)
TundraSoul
10-18-2002, 10:24 PM
.
TundraSoul
10-18-2002, 10:25 PM
Any way to close the forum, without logging into the control panel? I'm getting hundreds of email notices.
NTLDR
10-18-2002, 10:25 PM
Try running the following query via phpMyAdmin:
REPAIR TABLE `user`
TundraSoul
10-18-2002, 10:39 PM
I tried to repair both user and userfield, but no luck.
vbulletin.user repair error 28 when writing to datafile
vbulletin.userfield repair error 28 when writing to datafile
Originally posted by NTLDR
Try running the following query via phpMyAdmin:
REPAIR TABLE `user`
TundraSoul
10-18-2002, 11:20 PM
I'm in the process of uploading the restore file. A 200 MB upload will take a while.
TundraSoul
10-19-2002, 12:16 AM
Okay can someone help me restore the database?
I tried doing it using phpMyAdmin but got this error:
SQL-query :
CREATE DATABASE `forum`
MySQL said:
Can't create database 'forum'. (errno: 28)
what's error no. 28?
TundraSoul
10-19-2002, 06:04 AM
I ran out of disk space on the MySQL partition. But I corrected it, and repaired two tables, so everything is working well again.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.