PDA

View Full Version : Modification Log


burnist
11-15-2004, 10:00 PM
This hack will add a new option under Logs and Statistics in your Admin CP. It allows you to track which modifications you have installed on to your board by filling out the form in the hack to contain a name, Author name, Version Number,
Description and an Installation date.

This hack can be made dynamic so you do not have to add the info your self but a hack releaser would just need to add an extra query to the install to do it for you. In the future I intend to extend this to log which files have been modified in the hack and what queries have been run, possibly through making it into an installation system.

This hack was made out of a want to track what I have installed simply and without having to go to the trouble of installing the HTL. If the Author of that hack wants me to remove this I will as the original idea was essentially his.

2 hacks in 2 days :)


v 1.01 - Includes field for url to modification by HellRazor

Fargo
11-16-2004, 06:30 PM
Well, let me be the first to say, thank you!

It may be a simple hack, but it now does in the backend what I've been doing in hidden forums since I started using vBulletin.

Definately installing on my site soon.

Perhaps 1 request....how about a comments text area and an authors url input, as these would come in handy as well.

I usually make several comments about necessary alterations to the hack, or about specific directions that have not been updated to installed version. The authors url I keep handy so if necessary, I have a quick link to the download area of the hack (usually vbulletin.org)

burnist
11-16-2004, 08:00 PM
Perhaps 1 request....how about a comments text area and an authors url input, as these would come in handy as well.

I usually make several comments about necessary alterations to the hack, or about specific directions that have not been updated to installed version. The authors url I keep handy so if necessary, I have a quick link to the download area of the hack (usually vbulletin.org)

I will add those and release an update for you as soon as possible, im busy though so it may be next week :)

HiDeo
11-16-2004, 08:26 PM
Nice job, thanks for the release

Natch
11-16-2004, 09:54 PM
Great job!

Johnny
11-17-2004, 01:58 AM
nice mod, i remember the vb2 times when this was released.

jluerken
11-18-2004, 07:16 AM
Perhaps 1 request....how about a comments text area and an authors url input, as these would come in handy as well.


This is nice but I also wanna see a comment field there to have the chance to fill in the url where I got the hack etc.

Another nice option would be to be able to add a file to the entry so that you can add the hack to the entry.
Keeps you from searching if you have to install it again.

outlaw621
11-18-2004, 07:25 PM
When I run the Database Query I get the following error message:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(modid))' at line 8

I have cut and pasted the Query form the install file and have also tried to manually put it in. How can I fix this error?

burnist
11-18-2004, 07:47 PM
What version of mySQl are you using? I believe this may be a version problem and a change of syntax may be needed

outlaw621
11-18-2004, 08:01 PM
What version of mySQl are you using? I believe this may be a version problem and a change of syntax may be needed

Thank you for the quick reply.
I am currently using version 4.0.22-standard-log

burnist
11-18-2004, 08:19 PM
They worrying thing is the thats the same version I'm using. I just looked at the vB install file and it had the equivelant line broken into

PRIMARY KEY (modid)
)


Try that and maby it'll work :)

outlaw621
11-18-2004, 09:00 PM
They worrying thing is the thats the same version I'm using. I just looked at the vB install file and it had the equivelant line broken into

PRIMARY KEY (modid)
)


Try that and maby it'll work :)

I tried the following but I got the same error:
CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
authur varchar(250),
version varchar(250),
date int(10)
PRIMARY KEY (modid)
)
and I also tried it this way:
CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
authur varchar(250),
version varchar(250),
date int(10)
PRIMARY KEY(modid)
)

I tired both ways via vBulletin and also in phpMyAdmin.

burnist
11-19-2004, 09:29 AM
CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
authur varchar(250),
version varchar(250),
date int(10),
PRIMARY KEY(modid)
)


maby a comma after date int(10) may help =-/

outlaw621
11-19-2004, 09:43 AM
CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
authur varchar(250),
version varchar(250),
date int(10),
PRIMARY KEY(modid)
)


maby a comma after date int(10) may help =-/
That did it. Database was created without any errors. Thank you for all your help and patience.

burnist
11-19-2004, 03:56 PM
That did it. Database was created without any errors. Thank you for all your help and patience.

No problem, happy to help :P

jluerken
11-22-2004, 07:56 AM
No problem, happy to help :P
What about the comment field? *smile*

DS MrSinister
11-26-2004, 05:00 AM
I get this error when I try to add in the info of the hacks..

Database error in vBulletin 3.0.3:

Invalid SQL: INSERT INTO modslog (name,description,author,version,date) VALUES ('Modification Log','Manual Log of Modification add to vb','','1.0.0','1101452197')
mysql error: Unknown column 'author' in 'field list'

mysql error number: 1054

HellRazor
11-27-2004, 11:37 PM
That error is due to a bad SQL query in the install text. In the SQL query, "author" is misspelled as "authur".

To fix this:

In AdminCP, go to Execute SQL Query under Import & Maintenance.

First execute this query to delete the incorrect table:

DROP TABLE IF EXISTS modslog;

Then execute this query to create a corrected table;

CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
author varchar(250),
version varchar(250),
date int(10),
PRIMARY KEY(modid))

HellRazor
11-28-2004, 12:02 AM
Also, the instructions tell you to place the phrases under Control Panel Global. This is partially incorrect.

Place modslog_actions and modslog_name under Control Panel Global.

Place modslog_moddeleted, modslog_modedited, and modslog_modadded under Control Panel Stop Message.

HellRazor
11-28-2004, 12:35 AM
There is another spelling error in modslog.php, where "author" is again misspelled "author". If you don't correct this, the author's name will not get added when you enter a new modification to the log.

HellRazor
11-28-2004, 12:41 AM
Just to make this easier for everyone, here is the complete corrected package:

Corrected modslog.php:


<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

// ################################################## ######################
// ######################### START MAIN SCRIPT ############################
// ################################################## ######################

print_cp_header('Modification Log');

if (empty($_REQUEST['do']))
{
$_REQUEST['do'] = 'list';
}


if ($_REQUEST['do'] == 'list' ) {

$modsquery = $DB_site->query("SELECT * FROM modslog ORDER BY date");

if ($modsquery){
print_form_header('modslog', 'showset');
print_table_header('Modification Log', 5);
print_cells_row(array(
'Name',
'Version',
'Author',
'Date Installed',
//'Show Users'
'Actions'
), 1, '', 1);



while($mod = $DB_site->fetch_array($modsquery)){
$vbphrase['modslog_actions_compiled'] = construct_phrase($vbphrase['modslog_actions'], $mod['modid']);
$vbphrase['modslog_name_compiled'] = construct_phrase($vbphrase['modslog_name'], $mod['name'], $mod['description']);
$date = $date = date("D-d-M-y",$mod['date']);
print_cells_row(array($vbphrase['modslog_name_compiled'],$mod['version'],$mod['author'],$date,$vbphrase['modslog_actions_compiled']),0,'');
}

} else {
print_form_header('modslog', 'showset');
print_table_header('Modification Log', 1);
print_cells_row(array('There are currently No Modifications in the Log'),0,'');

}

print_table_footer();
}


//Form to add a mod to the list
if ($_REQUEST['do'] == 'add' ) {
print_form_header('modslog', 'new');
print_table_header('Add Modification to Log');
print_input_row('Name of Modification', 'name');
print_input_row('Description of the Modification\'s function', 'description');
print_input_row('Modification version number', 'version');
print_input_row('Author name', 'author');
print_submit_row($vbphrase['save'], 0);
}


//Form to edit a mod in the list
if ($_REQUEST['do'] == 'edit' ) {

$id = $_REQUEST['id'] ;
$id = addslashes($id);

$modsquery = $DB_site->query("SELECT * FROM modslog WHERE modid=$id ");
$mod = $DB_site->fetch_array($modsquery);


print_form_header('modslog', 'modify');
print_table_header('Edit Modification in the Log');
print_input_row('Name of Modification', 'name', $mod['name']);
print_input_row('Description of the Modification\'s function', 'description', $mod['description']);
print_input_row('Modification version number', 'version', $mod['version']);
print_input_row('Author name', 'author', $mod['author']);
construct_hidden_code(id, $id);
print_submit_row($vbphrase['save'], 0);
}

if ($_REQUEST['do'] == 'new' OR 'modify' ) {
$name = addslashes($_POST['name']);
$description = addslashes($_POST['description']);
$version = addslashes($_POST['version']);
$author = addslashes($_POST['author']);
$id = addslashes($_POST['id']);
}


if ($_REQUEST['do'] == 'new' ) {


$date = TIMENOW ;
$DB_site->query("INSERT INTO modslog (name,description,author,version,date) VALUES ('$name','$description','$author','$version','$dat e')");
define('CP_REDIRECT', 'modslog.php');
print_stop_message('modslog_modadded');
}

if ($_REQUEST['do'] == 'modify' ) {



$DB_site->query("UPDATE modslog SET name='$name',description='$description',author='$a uthor',version='$version' WHERE modid='$id' ");
define('CP_REDIRECT', 'modslog.php');
print_stop_message('modslog_modedited');
}

if ($_REQUEST['do'] == 'delete' ) {
$id = $_REQUEST['id'] ;
$id = addslashes($id);

$DB_site->query("DELETE FROM modslog WHERE modid='$id' ");

define('CP_REDIRECT', 'modslog.php');
print_stop_message('modslog_moddeleted');
}



echo '<div align="center"><br /><a href="modslog.php" > [Return to Modificaton Listing] </a> - <a href="modslog.php?do=add" > [Add a Modification to the Log] </a></div>' ;
print_cp_footer();


?>


Corrected instructions:


Corrected Instructions:

This hack will add a new option under Logs and Statistics in your Admin CP. It allows you to track which modifications you have installed on to your board by filling out the form in the hack to contain a name, Author name, Version Number, Description and an Installation date. This hack can be made dynamic so you do not have to add the info your self but a hack releaser would just need to add an extra query to the install to do it for you. In the future I intend to extend this to log which files have been modified in the hack and what queries have been run, possibly through making it into an installation system.

This hack was made out of a want to track what I have installed simply and without having to go to the trouble of installing the HTL. If the Author of that hack wants me to remove this I will as the original idea was essentially his.

--Copyright 2004 Stewart Ritchie/burnist/acid burn/acid/dogwood (me basicly).

--Provided as is, use at your own discression. I am not responsible if your vBulletin screws up so back up both files

before installing.
--Can only be distributed at vB.org

################################################## #############################
################################################## #############################

--------------------------------------------------------------------
File Uploads -- Upload modslog.php to /admincp/
--------------------------------------------------------------------

################################################## #############################
################################################## #############################
--------------------------------------------------------------------
Database Query -- Run This in PHPMyAdmin or another tool for DB Manipulation
--------------------------------------------------------------------

CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
author varchar(250),
version varchar(250),
date int(10),
PRIMARY KEY(modid))

################################################## #############################
################################################## #############################

--------------------------------------------------------------------
File Edits -- One One, its in admincp/index.php
--------------------------------------------------------------------

~~~~~~~~~
~Find~~~~
~~~~~~~~~
construct_nav_option($vbphrase['scheduled_task_log'], 'cronlog.php?do=choose', '<br />');

~~~~~~~~~~~~~~~~~
~Below Add~~~~~~~
~~~~~~~~~~~~~~~~~
construct_nav_option('Modification Log', 'modslog.php', '<br />');


################################################## #############################
################################################## #############################
--------------------------------------------------------------------
Phrases -- These get added to the Control Panel Global Phrase Group
--------------------------------------------------------------------

Title: modslog_actions
Text : <a href="modslog.php?do=edit&id={1}"> Edit Entry </a> <a href="modslog.php?do=delete&id={1}"> Delete Entry </a>


Title: modslog_name
Text : <b>{1}</b><br /> {2}

--------------------------------------------------------------------
Phrases -- These get added to the Control Panel Stop Message Group
--------------------------------------------------------------------

Title: modslog_moddeleted
Text : Your Modification was successfully removed from the log, you will now be returned to the listing


Title: modslog_modedited
Text : Your Modification was successfully edited, you will now be returned to the listing


Title: modslog_modadded
Text : Your Modification was successfully added to the log, you will now be returned to the listing

HellRazor
11-28-2004, 04:55 AM
Here's another update. This version now allows you to put in an optional URL for the entry. Clicking on the title of the mod in the list will take you to the URL you specify.

This version requires one additional phrase (modslog_name_url) and one additional field in the database table (modurl).

Hope the original author doesn't mind! :nervous:

Here are the updated files.

Modslog.php:


<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

// ################################################## ######################
// ######################### START MAIN SCRIPT ############################
// ################################################## ######################

print_cp_header('Modification Log');

if (empty($_REQUEST['do']))
{
$_REQUEST['do'] = 'list';
}


if ($_REQUEST['do'] == 'list' ) {

$modsquery = $DB_site->query("SELECT * FROM modslog ORDER BY date");

if ($modsquery){
print_form_header('modslog', 'showset');
print_table_header('Modification Log', 5);
print_cells_row(array(
'Name',
'Version',
'Author',
'Date Installed',
//'Show Users'
'Actions'
), 1, '', 1);


while($mod = $DB_site->fetch_array($modsquery)){
$vbphrase['modslog_actions_compiled'] = construct_phrase($vbphrase['modslog_actions'], $mod['modid']);

if (empty($mod['modurl'])){
$vbphrase['modslog_name_compiled'] = construct_phrase($vbphrase['modslog_name'], $mod['name'],
$mod['description']);
} else {
$vbphrase['modslog_name_compiled'] = construct_phrase($vbphrase['modslog_name_url'], $mod['name'], $mod['modurl'], $mod['description']);
}


$date = $date = date("D-d-M-y",$mod['date']);

print_cells_row(array($vbphrase['modslog_name_compiled'],$mod['version'],$mod['author'],$date,$vbphrase['modslog_actions_compiled']),0,'');
}

} else {
print_form_header('modslog', 'showset');
print_table_header('Modification Log', 1);
print_cells_row(array('There are currently No Modifications in the Log'),0,'');

}

print_table_footer();
}


//Form to add a mod to the list
if ($_REQUEST['do'] == 'add' ) {
print_form_header('modslog', 'new');
print_table_header('Add Modification to Log');
print_input_row('Name of Modification', 'name');
print_input_row('Description of the Modification\'s function', 'description');
print_input_row('Modification version number', 'version');
print_input_row('Author name', 'author');
print_input_row('Modification URL', 'modurl');
print_submit_row($vbphrase['save'], 0);
}


//Form to edit a mod in the list
if ($_REQUEST['do'] == 'edit' ) {

$id = $_REQUEST['id'] ;
$id = addslashes($id);

$modsquery = $DB_site->query("SELECT * FROM modslog WHERE modid=$id ");
$mod = $DB_site->fetch_array($modsquery);


print_form_header('modslog', 'modify');
print_table_header('Edit Modification in the Log');
print_input_row('Name of Modification', 'name', $mod['name']);
print_input_row('Description of the Modification\'s function', 'description', $mod['description']);
print_input_row('Modification version number', 'version', $mod['version']);
print_input_row('Author name', 'author', $mod['author']);
print_input_row('Modification URL', 'modurl', $mod['modurl']);
construct_hidden_code(id, $id);
print_submit_row($vbphrase['save'], 0);
}

if ($_REQUEST['do'] == 'new' OR 'modify' ) {
$name = addslashes($_POST['name']);
$description = addslashes($_POST['description']);
$version = addslashes($_POST['version']);
$author = addslashes($_POST['author']);
$modurl = addslashes($_POST['modurl']);
$id = addslashes($_POST['id']);
}


if ($_REQUEST['do'] == 'new' ) {


$date = TIMENOW ;
$DB_site->query("INSERT INTO modslog (name,description,author,version,modurl,date) VALUES ('$name','$description','$author','$version','$mod url','$date')");
define('CP_REDIRECT', 'modslog.php');
print_stop_message('modslog_modadded');
}

if ($_REQUEST['do'] == 'modify' ) {



$DB_site->query("UPDATE modslog SET name='$name',description='$description',author='$a uthor',modurl='$modurl',version='$version' WHERE modid='$id' ");
define('CP_REDIRECT', 'modslog.php');
print_stop_message('modslog_modedited');
}

if ($_REQUEST['do'] == 'delete' ) {
$id = $_REQUEST['id'] ;
$id = addslashes($id);

$DB_site->query("DELETE FROM modslog WHERE modid='$id' ");

define('CP_REDIRECT', 'modslog.php');
print_stop_message('modslog_moddeleted');
}



echo '<div align="center"><br /><a href="modslog.php" > [Return to Modificaton Listing] </a> - <a href="modslog.php?do=add" > [Add a Modification to the Log] </a></div>' ;
print_cp_footer();


?>


Here are the updated install instructions:


This hack will add a new option under Logs and Statistics in your Admin CP. It allows you to track which modifications you have installed on to your board by filling out the form in the hack to contain a name, Author name, Version Number, Description and an Installation date. This hack can be made dynamic so you do not have to add the info your self but a hack releaser would just need to add an extra query to the install to do it for you. In the future I intend to extend this to log which files have been modified in the hack and what queries have been run, possibly through making it into an installation system.

This hack was made out of a want to track what I have installed simply and without having to go to the trouble of installing the HTL. If the Author of that hack wants me to remove this I will as the original idea was essentially his.

--Copyright 2004 Stewart Ritchie/burnist/acid burn/acid/dogwood (me basicly).
--Provided as is, use at your own discression. I am not responsible if your vBulletin screws up so back up both files

before installing.
--Can only be distributed at vB.org





################################################## #############################
################################################## #############################
--------------------------------------------------------------------
File Uploads -- Upload modslog.php to /admincp/
--------------------------------------------------------------------


################################################## #############################
################################################## #############################
--------------------------------------------------------------------
Database Query -- Run This in PHPMyAdmin or another tool for DB Manipulation
--------------------------------------------------------------------

CREATE TABLE modslog (
modid int(10) auto_increment,
name varchar(250),
description varchar(250),
author varchar(250),
version varchar(250),
modurl varchar (250),
date int(10),
PRIMARY KEY(modid))


################################################## #############################
################################################## #############################

--------------------------------------------------------------------
File Edits -- One One, its in admincp/index.php
--------------------------------------------------------------------

~~~~~~~~~
~Find~~~~
~~~~~~~~~
construct_nav_option($vbphrase['scheduled_task_log'], 'cronlog.php?do=choose', '<br />');

~~~~~~~~~~~~~~~~~
~Below Add~~~~~~~
~~~~~~~~~~~~~~~~~
construct_nav_option('Modification Log', 'modslog.php', '<br />');


################################################## #############################
################################################## #############################
--------------------------------------------------------------------
Phrases -- All of these get added to the Control Panel Global Phrase Group
--------------------------------------------------------------------

Title: modslog_actions
Text : <a href="modslog.php?do=edit&id={1}"> Edit Entry </a> <a href="modslog.php?do=delete&id={1}"> Delete Entry </a>


Title: modslog_name
Text : <b>{1}</b><br /> {2}

Title: modslog_name_url
Test : <b><a href="{2}" target="_blank">{1}</a></b><br /> {3}

--------------------------------------------------------------------
Phrases -- All of these get added to the Control Panel Stop Message Group
--------------------------------------------------------------------

Title: modslog_moddeleted
Text : Your Modification was successfully removed from the log, you will now be returned to the listing


Title: modslog_modedited
Text : Your Modification was successfully edited, you will now be returned to the listing


Title: modslog_modadded
Text : Your Modification was successfully added to the log, you will now be returned to the listing

burnist
11-28-2004, 03:14 PM
Thanks for fixing those errors HellRazor, been far to busy with other things to be able to check up. Im going to update the the attached file and add your name to it :)

rh2004
12-01-2004, 03:46 PM
Hi when I edit a mod it gives me this error when I save it?


Database error in vBulletin 3.0.3:

Invalid SQL: UPDATE modslog SET name='infobar',description='added to satellite, default, blue thumb, xmas',author='Slapyo',modurl='https://vborg.vbsupport.ru/showthread.php?t=72279',versio n='1.04' WHERE modid='1'
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'n='1.04' WHERE modid='1'' at line 1

mysql error number: 1064

Date: Wednesday 01st of December 2004 12:44:10 PM
Script: http://www./adminpanel/modslog.php
Referer: http://www./adminpanel/modslog.php?do=edit&id=1
Username:
IP Address:




Any ideas

burnist
12-01-2004, 04:05 PM
Delete modslog.php from your server and upload the one in the zip file at I just uploaded in responce to your error, it "should" have fixed that now :)

rh2004
12-01-2004, 07:18 PM
Downloading .......


Uploading ;) ;)


Working fine thanks :)

HellRazor
12-02-2004, 01:25 AM
Thanks for fixing those errors HellRazor, been far to busy with other things to be able to check up. Im going to update the the attached file and add your name to it :)

No problem, I just got to playing around with it and thought I'd share. :) Thanks for creating it!

jluerken
12-14-2004, 07:45 AM
No problem, I just got to playing around with it and thought I'd share. :) Thanks for creating it!
Thanks for fixing this hack but there is one major problem in it.
Its not making use of any table prefixes.

I am using table prefixes for my board. Can this be added to the hack?

jluerken
12-17-2004, 08:59 PM
Thanks for fixing this hack but there is one major problem in it.
Its not making use of any table prefixes.

I am using table prefixes for my board. Can this be added to the hack?
no one?

Megareus Rex
12-25-2004, 12:11 PM
Excellent hack! Me luffs it :)

jluerken, here you go. I modded mine to include prefixes, so everyone should be able to enjoy it :)

(Note: The only difference between this modslog.php and the original is that this one has the table prefix code built into it)

JKeats
01-08-2005, 02:29 PM
i think i may have found a small miscommunication in the install instructions.

there's actually two instances of

construct_nav_option($vbphrase['scheduled_task_log'], 'cronlog.php?do=choose', '<br />');

in the admincp/index.php (at least there is in 3.0.5). here's what the block looks like

if (can_administer('canadmincron'))
{
construct_nav_option($vbphrase['scheduled_task_manager'], 'cronadmin.php?do=modify', '|');
construct_nav_option($vbphrase['add_new_scheduled_task'], 'cronadmin.php?do=edit', '<br />' );
construct_nav_option($vbphrase['scheduled_task_log'], 'cronlog.php?do=choose', '<br />');
construct_nav_group($vbphrase['scheduled_tasks']);
}
// ***
construct_nav_option($vbphrase['statistics'], 'stats.php?do=index', '<br />');
construct_nav_option($vbphrase['control_panel_log'], 'adminlog.php?do=choose', '|');
construct_nav_option($vbphrase['moderator_log'], 'modlog.php?do=choose', '<br />');
construct_nav_option($vbphrase['scheduled_task_log'], 'cronlog.php?do=choose', '<br />');

if you add

construct_nav_option('Modification Log', 'modslog.php', '<br />');

after the first instance instead of the second, the link to the new page wont be added.

i only discovered this becasue i added the line after the first instance and couldn't figure out why i wasn't getting my link. it's all good now that i moved it to after the second instance.

great mod. thanks!

Delphiprogrammi
01-15-2005, 09:32 AM
yeah sure but according to the site rules i gotta ask permission from the orginal author first he agreed :tired: all this does is add the "TABLE_PREFIX" thingy to database querys

rgds