vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Advanced Forum Properties part 2 (https://vborg.vbsupport.ru/showthread.php?t=34556)

Hoffi 01-27-2002 10:00 PM

some time ago, i asked if it's possible to enter an extra sorting option for each forum.
a small but Ppowerful hint came up from FireFly, and i build a Hack around it.

I hope it works and you like it.

What it does: it adds new Fileds to every Forum-Properties and you can select, if the Board-defaults were shown when the forum is opend, or you you can say which Row schould be sorted. Ascending or Descending is also selectable.
To build it as much as flexible, I add an Admin-Page, where you can Select some of all Listed Colums existing in the forum-Table. Even new added through Hack. So have only These Colums in your Drop-Down Box.

Part 1 of this Hack is the DaysPruneOverride Hack.
Later i will release all of them in one Big hack.

I hope you like it.
-----
Update:
The SQL ALTER-Command was wrong. Fixed.
-----
Update:
I must be blind and used the wrong table. Fixed.

Demo:
http://www.hoffi.org/demo.gif

MarkB 01-29-2002 02:40 AM

This looks like a great hack! I'll test it over the next couple of days :D

nuno 01-29-2002 04:52 AM

hmm
i cant understand 2nd screenshot :confused:
what is it for? :stoned:

Hoffi 01-29-2002 05:06 AM

I'll try to explain.

The 2nd Screenshot is what you get, if you click on "Sort Preselection" in the Menu.
Here I list all fields of the Forum-Table and you can specify which Colums should appear in the Drop-Down Box you can see in Screenshot 1.
I did this, because i won't set only a few fix Colums to sort. So you can select your own. Even if you added fields through a Hack, you can select this fields to see it in the sort-Drop-Down Box.

I hope this helps you to understand the 2nd screenshot.

Mark Hensler 01-29-2002 05:16 AM

haha... that's WinXP using the Windows Classic theme. What's wrong? Don'tcha like a 'squishy' GUI? ;)

DarkReaper 01-29-2002 09:02 PM

ALTER TABLE forum ADD sortdefault VARCHAR (4) DEFAULT 'DESC' not null, sortrow VARCHAR (255), sortoverride SMALLINT DEFAULT '0' not null

MySQL said:

You have an error in your SQL syntax near 'sortrow VARCHAR (255), sortoverride SMALLINT DEFAULT '0' not null' at line 1

Hoffi 01-29-2002 09:35 PM

Ups. mySQL don't like it, to add three rows on a time. Just change it to these three ALTER-SQL-Commands:

ALTER TABLE forum ADD sortdefault VARCHAR (4) DEFAULT 'DESC' not null

ALTER TABLE forum ADD sortrow VARCHAR (255)

ALTER TABLE forum ADD sortoverride SMALLINT DEFAULT '0' not null

then it works.

txt-File Updated.

Lesane 01-30-2002 09:06 AM

Great hack, thanks. :up:

DarkReaper 01-30-2002 07:26 PM

Um...in editsortrows, shouldn't it select all the properties of a thread, not a forum?

Hoffi 01-30-2002 07:42 PM

Quote:

Originally posted by DarkReaper
Um...in editsortrows, shouldn't it select all the properties of a thread, not a forum?
Why? I want to sort the Forum. So i see no need, to get any properties of the thread.

DarkReaper 01-31-2002 07:44 PM

Wait...doesn't this allow you to change the default sort settings of the threads within a forum? So when they go to the forum it defaults to sorting ASC/DESC ordered by title, posts, views, or whatever you choose?

Hoffi 01-31-2002 08:41 PM

Yes. It sorts the Threads in the specified Forum. But i don't use any thread-properties. The Threads inside the Forum were sorted like my choose in the CP. eg. Title, ASC.
With my Part 1 of the Hack, to override the User-Settings how old threads should be shown, this is perfect or an archive. Thats why i develop this Hacks.
When all is done, i will release on big Hack named Advanced Forum properties.

DarkReaper 02-01-2002 03:54 AM

I don't understand how you would be ordering threads a certain way by using properties that apply to the forum. It doesn't make sense...threads should be ordered by their own properties - replies, views, titles, starter, last poster, etc...not by the forum's properties. Just one example(because I'm too tired to list them all) - you wouldn't sort threads by the 'allowposting' option :)

Hoffi 02-01-2002 04:56 AM

D'oh!
Now I understand you. I must be blind... :D
Thanks DarkReaper!
It works, because the filed-names in both tables were nearly the same... I Updated the hack. The Changes were small, but now it is better.

Update:
First go to the New Menu. Sort Preselection.
Disable all Columns. (You not disable rows, if you are shure, the they are in both tables the same! e.g. title)

Opel admin/forum.php:

Search for:
PHP Code:

$sortinfos=$DB_site->query("describe forum"); 

It appears two times, replace both with:
PHP Code:

$sortinfos=$DB_site->query("describe thread"); 

Now you can reset you Sort Preselection! You will see, that the List is smaller. ;)

That's all!

LangTuDaTinh 02-08-2002 08:18 PM

I did install as you said and but it seems that ascending doesn't work. it always display in descending order. (note i changed to ASC in my forum properties) pls tell me what should i need to fix.

Hoffi 02-08-2002 09:23 PM

If you installed all Correctly, it must work. So please take a look, if you changed all correctly, and upload your files again.

I think you forgot some Code in forumdisplay.php

eg_92901 03-06-2002 11:50 AM

I had the same problem, I restored the original forumdisplay.php and reapplied the code just for that page and it works now.

Thanks for the great hack, its just what I needed! :D

ladyfyre 06-12-2002 01:34 PM

Two questions:

1. Will this work with 2.2.6?

2. Can you add the option to allow a sort by the date the thread was started?

Hoffi 06-13-2002 03:24 PM

I haven't tested it with 2.2.6
You can chooser yourself which Table-Fields are Displayed in the Drop-Down Box. I am just not shure if this Date is in one of the Fileds, if yes you can do It by Yourself. Otherwise i must take a look to the DB-Structure.

Pontemonti 07-31-2002 05:46 PM

I got it to work with 2.26.
I had one problem, though - I had to modify forumdisplay.php

Find:
PHP Code:

switch ($sortfield) { 

Now, the fields you want to be able to sort on should be added below that line...For example, I wanted to sort on threadid (making the forum display the threads in the order which they were posted), so I added the following line:
PHP Code:

  case 'threadid'


I also made a template modification to allow everyone to sort on threadid...I modified this template:
forumdisplay_threadslist

Find:
PHP Code:

<option value="title" $sort[title]>thread title</option

Add below:
PHP Code:

<option value="threadid" $sort[threadid]>thread post time</option


Okay, that should be it. A small improvement...hope it helps someone :nervous:

X-Fan 12-23-2002 04:40 AM

Quote:

Originally posted by Hoffi
If you installed all Correctly, it must work. So please take a look, if you changed all correctly, and upload your files again.

I think you forgot some Code in forumdisplay.php

I'm having a similar problem on v2.2.8 - it's only sorting by descending, not ascending even though I've got the sort order set to ascending. And I've triple-checked the code, and it's all been added/changed correctly.

Help!

kevinnguyen 06-01-2003 12:11 AM

Quote:

02-08-02 at 11:18 PM LangTuDaTinh said this in Post #15
I did install as you said and but it seems that ascending doesn't work. it always display in descending order. (note i changed to ASC in my forum properties) pls tell me what should i need to fix.
i got the same prob on 2.3.0 *sigh*
i was looking for this hack

kevinnguyen 06-01-2003 10:25 PM

nevermind
fixed the problem

X-Fan 06-02-2003 12:41 AM

How'd you fix it?

kevinnguyen 06-02-2003 12:46 AM

somehow the code doesnt accept the capital letters (ASC, DESC) so i replaced them w/ (asc, desc)

in admin/forum.php
Find:
Code:

makecustomchoosercode ("Default sort order","sortdefault","ASC,DESC");
Change it to:
Code:

makecustomchoosercode ("Default sort order","sortdefault","asc,desc");
Find:
Code:

makecustomchoosercode ("Default sort order","sortdefault","ASC,DESC",$forum[sortdefault]);
Replace w/:
Code:

makecustomchoosercode ("Default sort order","sortdefault","asc,desc",$forum[sortdefault]);
It should work fine now

X-Fan 06-02-2003 12:54 AM

You mean admin/forum.php ;)

kevinnguyen 06-02-2003 12:55 AM

yeah, sorry :D

noonespecial 04-06-2004 01:19 AM

Quote:

Originally Posted by kevinnguyen
yeah, sorry :D

this is NEEDED for vb3

Hoffi 06-16-2004 10:32 AM

Quote:

Originally Posted by noonespecial
this is NEEDED for vb3

Indeed. I will be build it next time.


All times are GMT. The time now is 04:50 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.01301 seconds
  • Memory Usage 1,788KB
  • 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
  • (4)bbcode_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)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