vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Simple: seperate unactive products in Products Manager (https://vborg.vbsupport.ru/showthread.php?t=281646)

vbenhancer 04-15-2012 10:00 PM

Simple: seperate unactive products in Products Manager
 
Just a simple tweak to list your products in order of "inactive/active" so you can track easily the products that are enable or not... way easier to read than the regular display that only have titles striked.

from /admincp/plugin.php

FIND ON LINE 707

PHP Code:

    $products $db->query_read("
        SELECT *
        FROM " 
TABLE_PREFIX "product
        ORDER BY title
    "
); 


ADD "active, " SO IT SHOWS AS:

PHP Code:

    $products $db->query_read("
        SELECT *
        FROM " 
TABLE_PREFIX "product
        ORDER BY active, title
    "
); 

that's it, yeap... now, visit http:/ /yoursite.com/admincp/plugin.php?do=product to see the result!

--------------- Added [DATE]1334607427[/DATE] at [TIME]1334607427[/TIME] ---------------

... i was bored to scroll down today, so it took me 32 seconds to fix that!... ;)

Lynne 04-16-2012 08:10 PM

Nice!

And if you want to list them as enabled first, and then disabled, add DESC to the ORDER clause:
PHP Code:

ORDER BY active DESCtitle 


Boofo 04-16-2012 08:32 PM

Or you could install the Advanced Product Management mod and not have to edit any files.

vbenhancer 04-16-2012 09:17 PM

Quote:

Originally Posted by Boofo (Post 2320711)
Or you could install the Advanced Product Management mod and not have to edit any files.

the point here is to just small-trick the engine, not replace it with something else... but yes, the APM could be good for some people!

Boofo 04-16-2012 09:46 PM

A lot of users here are not comfortable with editing files. That is the only reason I mentioned it.

Lynne 04-17-2012 02:37 AM

Quote:

Originally Posted by Boofo (Post 2320732)
A lot of users here are not comfortable with editing files. That is the only reason I mentioned it.

And some users would rather do a quick, simple file edit rather than install a product to do the same thing.

It's always good to have options. :)

vbenhancer 04-17-2012 10:46 AM

stop fighting in my article, kids...

Lynne 04-17-2012 05:14 PM

Boofo and I don't fight. Sorry if it looked that way. I ♥ Boofo. :)


All times are GMT. The time now is 05:40 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.01342 seconds
  • Memory Usage 1,727KB
  • 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
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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