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


All times are GMT. The time now is 10:00 PM.

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.02284 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete