vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   vBulletin Project Tools - vBulletin Project Tools - Color to Indicate Status (https://vborg.vbsupport.ru/showthread.php?t=155535)

Delphiprogrammi 08-22-2007 08:48 AM

hi,

IT IS WORKING !!!!!!!!!! look in the screenshot (attched to this post) click that small area next to the input field will bring up vBulletin cpcolorpicker.I managed to "integrate" it into Project Tools.I don't know if i will share it through :p

Delphiprogrammi 08-23-2007 01:26 PM

actually you can kill one more file edit ....

hook:issuestatusdata_start

code

PHP Code:

$this->validfields['background'] = array(TYPE_STR,REQ_NO); 

that will kill the class_dm_pt_issuestatus.php edit

Delphiprogrammi 08-23-2007 07:50 PM

hi,

To get the vBulletin default colorpicker working in the Porject Tools admin page (project.php) you need

edit

step 1

open /admincp/project.php and find

PHP Code:

print_cp_header($vbphrase['project_tools']); 

replace with

PHP Code:

print_cp_header($vbphrase['project_tools'],'init_color_preview()');
?>
<script type="text/javascript" src="../clientscript/vbulletin_cpcolorpicker.js"></script>
<?php

step 2

find (and remove this line)

PHP Code:

print_input_row($vbphrase['background_color'],'background',$issuestatus['background'],true,5); 

step 3

find this line

PHP Code:

print_yes_no_row($vbphrase['can_create_petitions_from_this_status'], 'canpetitionfrom'$issuestatus['canpetitionfrom']); 

below that add this

PHP Code:

require_once(DIR '/includes/adminfunctions_template.php');
 
$colorPicker construct_color_picker(11);
 echo 
"<tr>
  <td class=\"alt1\">
$vbphrase[background_color]</td>
  <td class=\"alt1\">
   <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
   <tr>
    <td><input type=\"text\" class=\"bginput\" name=\"background\" id=\"color_0\" value=\"
{$issuestatus['background']}\" title=\"background\" tabindex=\"1\" size=\"22\" onchange=\"preview_color(0)\" dir=\"ltr\" />&nbsp;</td>
    <td><div id=\"preview_0\" class=\"colorpreview\" onclick=\"open_color_picker(0, event)\"></div></td>
   </tr>
   </table>
  </td>
 </tr>\n"


step 4

find this lines

PHP Code:

construct_hidden_code('issuestatusid'$issuestatus['issuestatusid']);
 
print_submit_row(); 

below that add

PHP Code:

echo $colorPicker;
 ?>
 <script type="text/javascript">
 <!--
 var bburl = "<?php echo $vbulletin->options['bburl']; ?>/";
 var cpstylefolder = "<?php echo $vbulletin->options['cpstylefolder']; ?>";
 var numColors = 1;
 var colorPickerWidth = <?php echo intval($colorPickerWidth); ?>;
 var colorPickerType = <?php echo intval($colorPickerType); ?>;
 //-->
 </script>
<?php

that should do it

Quarterbore 08-24-2007 01:18 AM

Thanks for working on this... I wanted to work on it as well before I left for a trip but I ran out of time. I will help (if you need it) when I get back next week.

Quarterbore 08-26-2007 10:43 PM

I am just getting home from a trip so it will take me a while to get back into a routein that I can fight with this... I have added Delphiprogrammi as a Co-Author!

EDIT:

OK, I am not sure this is all of the edits but it should be... this will add a small table to the main issue status listing so that the colors for each status will be displayed.

All of these edits are in Admin/project.php

FIND:

PHP Code:

        print_cells_row(array(
            
'<span class="normal">' $vbphrase['status'] . '</span>',
            
'<span class="normal">' $vbphrase['display_order'] . '</span>',
            
'<b>' construct_link_code($vbphrase['add_status'], 'project.php?do=statusadd&amp;type=' $type['issuetypeid']) . '</b>'
        
), true); 


REPLACE WITH:

PHP Code:

        print_cells_row(array(
            
'<span class="normal">' $vbphrase['status'] . '</span>',

            
'<span class="normal">' $vbphrase['display_order'] . '</span>',

            
'<span class="normal">' $vbphrase['background_color'] . '</span>',

            
'<b>' construct_link_code($vbphrase['add_status'], 'project.php?do=statusadd&amp;type=' $type['issuetypeid']) . '</b>'
        
), true); 

FIND:

PHP Code:

print_cells_row(array(
                    
$vbphrase["issuestatus$status[issuestatusid]"],
                    
"<input type=\"text\" class=\"bginput\" name=\"order[$status[issuestatusid]]\" value=\"$status[displayorder]\" tabindex=\"1\" size=\"3\" />",
                    
"<div align=\"$stylevar[right]\" class=\"smallfont\">" .
                        
construct_link_code($vbphrase['edit'], 'project.php?do=statusedit&amp;issuestatusid=' $status['issuestatusid']) .
                        
construct_link_code($vbphrase['delete'], 'project.php?do=statusdelete&amp;issuestatusid=' $status['issuestatusid']) .
                    
'</div>'
                
)); 

REPLACE WITH:

PHP Code:

print_cells_row(array(
                    
$vbphrase["issuestatus$status[issuestatusid]"],
                    
"<input type=\"text\" class=\"bginput\" name=\"order[$status[issuestatusid]]\" value=\"$status[displayorder]\" tabindex=\"1\" size=\"3\" />",
                    
"<table height=\"24\" width=\"85\" cellpadding=\"0\" cellspacing=\"0\" border=\"1\">
                    <tr><td style=\"background-color: 
$status[background]\"><font color = \"black\"> $status[background] </font></td>
                    </tr></table>"
,
                    
"<div align=\"$stylevar[right]\" class=\"smallfont\">" .
                        
construct_link_code($vbphrase['edit'], 'project.php?do=statusedit&amp;issuestatusid=' $status['issuestatusid']) .
                        
construct_link_code($vbphrase['delete'], 'project.php?do=statusdelete&amp;issuestatusid=' $status['issuestatusid']) .
                    
'</div>'
                
)); 

FIND:

PHP Code:

print_submit_row($vbphrase['save_display_order'], ''3); 

REPLACE WITH:

PHP Code:

print_submit_row($vbphrase['save_display_order'], ''4); 


dave_finlayson 08-31-2007 12:45 PM

Great mod but it doesn't seem to work for search results. Can it be amended to do so?

Delphiprogrammi 08-31-2007 07:56 PM

Quote:

Originally Posted by dave_finlayson (Post 1329465)
Great mod but it doesn't seem to work for search results. Can it be amended to do so?

well i didn't know it didn't worked in search results until i saw your post and i didn't liked it either so here we go to make it work within the search results

1)open hooks_vbprojecttools.xml (/includes/xml folder from the pt distrubution) and find

Code:

<hook>projectsearch_results_groupbit</hook>
replace that with

Code:

<hook>projectsearch_results_bit</hook>
<hook>projectsearch_results_groupbit</hook>

upload the modified hooks_vbprojecttools.xml to /includes/xml

2)create a new plugin with this information
  • product: Project Tools Status Colors
  • hook:projectsearch_results_bit
  • phpcode

    $get_background = $vbulletin->db->query_first("SELECT background FROM " . TABLE_PREFIX . "pt_issuestatus WHERE issuestatusid='{$issue['issuestatusid']}'");
    $issue['background'] = $get_background['background'];
  • active:yes
3)edit template pt_searchresultbit and add the background color in all "<td>" tags like this

HTML Code:

<td class="alt2" align="center" style="background-color:$issue[background]">
all done

Quarterbore 09-01-2007 07:04 PM

Quote:

Originally Posted by Delphiprogrammi (Post 1329707)
well i didn't know it didn't worked in search results until i saw your post and i didn't liked it either so here we go to make it work within the search results

<snip>

all done

Great job!

Also a note to anyone else that the hook is already in the search file but there was a known bug in the xml file where the hook location was missed!

Delphiprogrammi 09-02-2007 11:10 AM

hi,

or you could "kill" the template edits by doing it like this

hook project_issuebit find

PHP Code:

$get_background $vbulletin->db->query_first("SELECT background FROM " TABLE_PREFIX "pt_issuestatus  WHERE issuestatusid = $issue[issuestatusid] LIMIT 1");
$issue[background] = $get_background[background]; 

below add

PHP Code:

$vbulletin->templatecache['pt_issuebit'] = preg_replace('/<td class=\\\"alt2\\\"/''<td style=\"background-color:$issue[background]\"'$vbulletin->templatecache['pt_issuebit']);
$vbulletin->templatecache['pt_issuebit'] = preg_replace('/<td class=\\\"alt1\\\"/''<td style=\"background-color:$issue[background]\"'$vbulletin->templatecache['pt_issuebit']);
$vbulletin->templatecache['pt_issuebit'] = preg_replace('/<td class=\\\"alt2 smallfont\\\"/''<td style=\"background-color: $issue[background]\" class=\"smallfont\"'$vbulletin->templatecache['pt_issuebit']);
$vbulletin->templatecache['pt_issuebit'] = preg_replace('/<td class=\\\"alt1 smallfont\\\"/''<td style=\"background-color: $issue[background]\" class=\"smallfont\"'$vbulletin->templatecache['pt_issuebit']); 

hook projectsearch_results_bit find

PHP Code:

$get_background $vbulletin->db->query_first("SELECT background FROM " TABLE_PREFIX "pt_issuestatus WHERE issuestatusid='{$issue['issuestatusid']}'");
$issue['background'] = $get_background['background']; 

below add

PHP Code:

$vbulletin->templatecache['pt_searchresultbit'] = preg_replace('/<td class=\\\"alt2\\\"/''<td style=\"background-color: $issue[background]\"'$vbulletin->templatecache['pt_searchresultbit']);
$vbulletin->templatecache['pt_searchresultbit'] = preg_replace('/<td class=\\\"alt1\\\"/''<td style=\"background-color: $issue[background]\"'$vbulletin->templatecache['pt_searchresultbit']);
$vbulletin->templatecache['pt_searchresultbit'] = preg_replace('/<td class=\\\"alt2 smallfont\\\"/''<td style=\"background-color: $issue[background]\" class=\"smallfont\"'$vbulletin->templatecache['pt_searchresultbit']);
$vbulletin->templatecache['pt_searchresultbit'] = preg_replace('/<td class=\\\"alt1 smallfont\\\"/''<td style=\"background-color: $issue[background]\" class=\"smallfont\"'$vbulletin->templatecache['pt_searchresultbit']); 

that should do it

Delphiprogrammi 09-02-2007 04:36 PM

there is an error in the product uninstall code the MySQL query should be

PHP Code:

$db->query_write("ALTER TABLE " TABLE_PREFIX "pt_issuestatus DROP background"); 



All times are GMT. The time now is 04: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.01270 seconds
  • Memory Usage 1,836KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (19)bbcode_php_printable
  • (2)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