Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Template Editing: Show Difference Details »»
Template Editing: Show Difference
Version: 1.00, by tdev1 tdev1 is offline
Developer Last Online: Apr 2016 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.2.0 Rating:
Released: 03-09-2013 Last Update: Never Installs: 5
Re-useable Code Code Changes Translations  
No support by the author.

This little php code will show the difference of your template to the default one: it can help you maintaining the modifications you did to the templates


How to install:

a) make a backup of the file admincp/template.php:
Code:
cp admincp/template.php admincp/template_original.php
b) apply the attached patch:
Code:
patch -p0 < template_mod.diff.txt
c) install Text_Diff via pear:
Code:
pear install Text_Diff

Download Now

File Type: txt template_mod.diff.txt (2.5 KB, 42 views)

Screenshots

File Type: jpg template_edit_before.jpg (39.6 KB, 0 views)
File Type: jpg template_edit.jpg (73.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-08-2020, 04:00 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know this is older but I have adapted it to vB3 but the differences aren't displaying, I have gone through the diff files and I'm not catching what needs to be changed, I have tried replacing all &$ with $ I didn't see any splits to explode, and my logs aren't reporting any error

I know the author has not been on in years, but I was just hoping someone would be able to help me with this. Running vb3.8.11 on php 5.4.60 (i believe)

below are the edits I made to work with vb3, and the files required for this edit.

PHP Code:
$masterstyleid '-1'//vb4 defines this as -1 or -2 (default or mobile)  /vb3 master is -1
$templateo $db->query_first("
  SELECT templateid, styleid, title, template_un
  FROM " 
TABLE_PREFIX "template
  WHERE styleid IN (
$masterstyleid,0)
  AND title = '" 
$db->escape_string($template['title']) . "'
"
);
$texto $templateo['template_un'];
if(
trim($texto) != '') {
  
print_textarea_row('<span style="color:green;font-weight:bold;">Default '.$vbphrase['template'].'</span>''templateo'$texto22'75" style="width:99%'truefalse'ltr''code');
  @include_once 
'Text/Diff.php';
  @include_once 
'Text/Diff/Renderer/inline.php';
  if(
class_exists('Text_Diff') && class_exists('Text_Diff_Renderer_inline')) {
    
$diff = new Text_Diff('auto', array(explode("\n"$texto), explode("\n"$text)));
    
$renderer = new Text_Diff_Renderer_inline(array('ins_prefix' => '<span style="color:green;font-weight:bold;">','ins_suffix' => '</span>','del_prefix' => '<span style="color:red;font-weight:bold;">','del_suffix' => '</span>'));
    
$fdiff $renderer->render($diff);
    
print_label_row('<span style="color:orange;font-weight:bold;">Difference</span><br/><small>red=removed,<br/>green=added</small>''<div style="background-color:white;font-size:0.9em;border:1px solid black;white-space: pre;font-family: "Courier New", monospace;">'.$fdiff.'</div>');
  } else {
    
print_label_row('<span style="color:orange;font-weight:bold;">Difference</span>''For this feature to work, please install <a href="http://pear.php.net/package/Text_Diff">PEAR Text_Diff</a>:<br/><pre>$ sudo pear install Text_Diff</pre>');
  }
} else {
  
print_label_row('Original''There is no original version for this template.');

And have placed it under line 2116:
PHP Code:
'template'$template['template_un'], 22'75" style="width:100%'truetrue'ltr''code'); 
I have placed the Text folder in my root

Its displaying how it should, BUT it is not showing differences.
Attachment 157758
Attached Files
File Type: zip Text.zip (22.4 KB, 5 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03811 seconds
  • Memory Usage 2,245KB
  • Queries Executed 16 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (4)postbit_attachment
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete