vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   [APM] Advanced Product Management 2.0.4 (https://vborg.vbsupport.ru/showthread.php?t=95741)

mtha 09-05-2005 10:00 PM

[APM] Advanced Product Management 2.0.4
 
[APM] Advanced Product Management 2.0.4

/*================================================* \
|| ########################################## ||
|| # Advanced Product Management [APM] v2.0.3 ? by HacNho
|| # Copyright (C) 2005 by HacNho, All rights reserved.
|| # ----------------------------------------------------------
|| # For use with vBulletin Version 3.5.1 and later
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html
|| # Discussion and support available at
|| # https://vborg.vbsupport.ru/showthread.php?t=95741
|| ########################################## ||
\*================================================ =*/

Hack Version: 2.0.3.051105
Compatible vB version: 3.5.1 (and later)
Support: https://vborg.vbsupport.ru/showthread.php?t=95741
Translated Versions:
http://www.vbhacks-germany.com/forum...ead.php?t=1971

NOTE: This release is to fix few function name changes in vB 3.5.1
if you have vB 3.5.0, please DONOT upgrade to this version
For vB version later than 3.5.1, you can use the version for 3.5.1 (was named for 3.5.1 only) without problem.

Beta release for vB 3.6.0 RC2 is AVAILABLE here:
https://vborg.vbsupport.ru/showthread.php?t=121792

DESCRIPTION:

A center product area which allow you to manage all codes/plugins/templates/phrases/settings for any product.
It also add some additional fields to the product, just to save more information with a product
Release Date
Product Author
Related URL
Extra Information

The extra information is only available if you install APM, and use APM to export/import other product.
It does not have any conflict with original product. You still can use APM to import standard product, or use standard product tool to import APM's product files.

CHANGES/MODIFICATION:

- Query: 1 (ADD 5 additional fields to product table)
- Files to add: 5
- Product to import: 1

INSTALL:
(2005.10.06: for safer installation, please do step 2 (import the product) first, then upload the files.)

2. Import XML product product-adv_product_management.xml using vBulletin standard product import tool.
1. Upload all files in UPLOAD folder to your server
3. Refresh menu panel to display Advanced Product Management link in Plugin System section

{optional} - Re-import product-adv_product_management.xml using APM import product tool, with Allow Overwrite = Yes
This step is inserting more information into the product.

* CAUTION: DONOT use APM to import product-adv_product_management.xml BEFORE step 2.


SCREENSHOT:
Included


HISTORY:
v1.0: Initial release
v1.1: Improve count queries, thanks to KirbyDE, some bugs fix
v1.2: Add collapsible blocks into product detail
2005.10.02: version 2.0: Alot of improvement. More product information fields. Better product's component adding/editting
2005.10.03: version 2.0.1: FIX bug on updateactive plugins in one product that de-active all other plugins. upgrade is recommended for the function to work right
2005.10.06: v2.0.2 Fix post #41 bug when debug mod is on

2005.11.05: v2.0.3 Fix bug on post #48 for vBulletin 3.5.1
{NOTE: This release is to fix few function name changes in vB 3.5.1
if you have vB 3.5.0, please DONOT upgrade to this version}

2006.03.20: v. 2.0.4 fix bug on post #64

2006.07.21: v. 3.0.0
Beta release for vB 3.6.0 RC2 is AVAILABLE here:
https://vborg.vbsupport.ru/showthread.php?t=121792

mtha 09-06-2005 10:17 AM

reserved for updates

uae 09-06-2005 10:29 AM

You guys are on fire, and the sky is raining mo and mo cool hacks.

Keep'em coming :)

Thanks for sharing mtha

Snake 09-06-2005 10:42 AM

Thanks for the hack.

Andreas 09-06-2005 12:55 PM

Dunno if it is just me, but
PHP Code:

    $products $db->query_read("
        SELECT pr.* 
            ,count(DISTINCT pl.pluginid) AS plugin
            ,count(DISTINCT ph.phraseid) AS phrase
            ,count(DISTINCT templateid) AS template
#            ,count(DISTINCT se.varname) AS setting
        FROM " 
TABLE_PREFIX "product AS pr
        LEFT JOIN " 
TABLE_PREFIX "plugin AS pl ON (pl.product = pr.productid)
        LEFT JOIN " 
TABLE_PREFIX "phrase AS ph ON (ph.product = pr.productid)
        LEFT JOIN " 
TABLE_PREFIX "template AS te ON (te.product = pr.productid)
#        LEFT JOIN " 
TABLE_PREFIX "setting AS se ON (se.product = pr.productid)
        GROUP BY productid
        ORDER BY title"
);
while (
$product $db->fetch_array($products)) 

keeps killing my Server. This Query takes over 1 Minute to execute and while it does run, the machine is almost unusable - CPU 100%.

Therefore I replaced that Code with
PHP Code:

    $productq $db->query_read("SELECT * FROM " TABLE_PREFIX "product ORDER BY title");
    while (
$product $db->fetch_array($productq))
    {
        
$products["$product[productid]"] = $product;
        
$products["$product[productid]"]['plugin'] = 0;
        
$products["$product[productid]"]['phrase'] = 0;
        
$products["$product[productid]"]['template'] = 0;
        
$products["$product[productid]"]['setting'] = 0;
    }

    
$pluginq $db->query_read("SELECT product, COUNT(pluginid) AS plugin FROM " TABLE_PREFIX "plugin WHERE product != 'vbulletin' GROUP BY product");
    while (
$plugin $db->fetch_array($pluginq))
    {
        
$products["$plugin[product]"]['plugin'] = $plugin['plugin'];
    }

    
$phraseq $db->query_read("SELECT product, COUNT(phraseid) AS phrase FROM " TABLE_PREFIX "phrase WHERE languageid=-1 AND product != '' AND product != 'vbulletin' GROUP BY product");
    while (
$phrase $db->fetch_array($phraseq))
    {
        
$products["$phrase[product]"]['phrase'] = $phrase['phrase'];
    }

    
$templateq $db->query_read("SELECT product, COUNT(templateid) AS template FROM " TABLE_PREFIX "template WHERE styleid=-1 AND product != '' AND product != 'vbulletin'GROUP BY product");
    while (
$template $db->fetch_array($templateq))
    {
        
$products["$template[product]"]['template'] = $template['template'];
    }
    
    
$settingq $db->query_read("SELECT product, COUNT(varname) AS setting FROM " TABLE_PREFIX "setting WHERE product != '' AND product != 'vbulletin' GROUP BY product");
    while (
$setting $db->fetch_array($settingq))
    {
        
$products["$setting[product]"]['setting'] = $setting['setting'];
    }        

    foreach (
$products AS $product

This shows the Results instantly.

Andreas 09-06-2005 01:39 PM

Just a thought:
If you could make it so the Blocks (Product Details, Install/Uninstall Codes, etc.) are collapsable and when editing/adding an Item one gets taken back to the advanced Product Edit Page - that would be perfect :D

Boofo 09-06-2005 01:54 PM

I used your code above Kirby and I got a line that is blank at the bottom of the listing that says it has 11 plugins and an x under the settings column.

mtha 09-06-2005 03:53 PM

Quote:

Originally Posted by KirbyDE
Dunno if it is just me, but
keeps killing my Server. This Query takes over 1 Minute to execute and while it does run, the machine is almost unusable - CPU 100%.

well, i was trying to save few queries but it doesnt seem to do much good hah. it took about 1 second for that code to run on my server. Anyway I will switch to using your code then. Thanks for the code :)

Quote:

Just a thought:
If you could make it so the Blocks (Product Details, Install/Uninstall Codes, etc.) are collapsable and when editing/adding an Item one gets taken back to the advanced Product Edit Page - that would be perfect [img]images/newsm/grin.gif[/img]
hehe, yeah. i just thought about the collapsing blocks this morning. it was a quick extension in few hours, so I havent got anything fancy in there yet.

A perfect product should be completed, yes. At the moment, it's only a quick link to other sections. I will gather some more code in there :)

Quote:

I used your code above Kirby and I got a line that is blank at the bottom of the listing that says it has 11 plugins and an x under the settings column.
I didnt try the code, but x means you dont have any setting for the coresponding product. I will come back with a new code tonight though

Revan 09-06-2005 05:03 PM

Can you please try to make it look like Live Wire in the thread you got the idea from? If you will, then notice my idea of making disabled plugins red.
If you do then this will rox0r t3h b0x0rz and youll have my install.

Btw why is the 2nd ss showing the hack printing a "Edit vBulletin Options"-ish page underneath the notice of there being no Settings?

evesve 09-06-2005 05:22 PM

Hi!
I have upload both files to the right place.
Refresh the side, but I don´t have the Advanced Manage Product in the Plugin System.
(RC1)

What´s wrong?


All times are GMT. The time now is 01:54 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.01979 seconds
  • Memory Usage 1,785KB
  • 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
  • (3)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