vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Req: User decides post direction (https://vborg.vbsupport.ru/showthread.php?t=44726)

TundraSoul 10-18-2002 05:33 PM

Req: User decides post direction
 
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 06: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:

PHP Code:

$posts=$DB_site->query(

Before that add:

PHP Code:

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 07: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 07:23 PM

Quote:

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 08:12 PM

.

TundraSoul 10-18-2002 08: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 08: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 08:57 PM

.

TundraSoul 10-18-2002 09:09 PM

.

Logician 10-18-2002 09: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 09:11 PM

Quote:

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 09:17 PM

I should use VB's repair.php in the admin directory?

Quote:

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 09:18 PM

What repair do you mean?

NTLDR 10-18-2002 09:20 PM

Quote:

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 09: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.


Quote:

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 09:24 PM

.

TundraSoul 10-18-2002 09: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 09:25 PM

Try running the following query via phpMyAdmin:

[sql]REPAIR TABLE `user`[/sql]

TundraSoul 10-18-2002 09: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

Quote:

Originally posted by NTLDR
Try running the following query via phpMyAdmin:

[sql]REPAIR TABLE `user`[/sql]


TundraSoul 10-18-2002 10:20 PM

I'm in the process of uploading the restore file. A 200 MB upload will take a while.

TundraSoul 10-18-2002 11:16 PM

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 05: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.


All times are GMT. The time now is 03:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01607 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete