DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • May 18, 2013, 02:37:21 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: Changelog  (Read 899 times)
0 Members and 1 Guest are viewing this topic.
Stephen Kise
Codemeister
****
Offline Offline

Posts: 372



View Profile WWW
« on: June 18, 2011, 02:33:30 PM »

Author: Stephen Kise
Module: Changelog
Compatability: Tested on 1.1.2, should work on 1.1.0+
Current Version: Beta 1 (0.1b) (June 17, 2011)
File Submission: Here

This module needs a new table in the database. I SUGGEST OPENING THE ZIP AND READING THE README BEFORE THROWING IT IN THE MODULES FOLDER.
This has a file to be placed in the lib directory as well as the modules  directory. The READ ME file in the zip will tell you the stuff to add in the table you need to make in MySQL.
I have added !kickme in the author's section of the module because he helped me with the date(); function. (Thanks so much!)
Logged
KaosKaizer
Mod God
*****
Offline Offline

Posts: 1000


Love bites, but so do I!


View Profile
« Reply #1 on: June 18, 2011, 07:52:57 PM »

Anytime you create, drop, or query a DB table from LotGD, you need to make sure you include db_prefix(); because some users will have a prefix for their tables. Just follow the updates below. EDIT, the first statement is from lib/changelog.php and the second is from modules/changelog.php.

Code:
<?php
// THIS
$sql "INSERT INTO `changelog` ( `id` , `date` , `title` , `desc` , `affected` ) VALUES (NULL ,'".date("Y-m-d")."', '".$title."', '".$desc."', '".$affected."')";
// AND THIS
$sql "SELECT * FROM changelog ORDER BY id DESC";
// SHOULD BE
$sql "INSERT INTO `".db_prefix("changelog")."` ( `id` , `date` , `title` , `desc` , `affected` ) VALUES (NULL ,'".date("Y-m-d")."', '".$title."', '".$desc."', '".$affected."')";
// AND
$sql "SELECT * FROM ".db_prefix("changelog")." ORDER BY id DESC";
Logged

My Mods
Like to read? "Like" my page. Smiley
For reasons I'd prefer not to explain, I will not be active until further notice. I will not make any posts and I will ignore all PMs.
Stephen Kise
Codemeister
****
Offline Offline

Posts: 372



View Profile WWW
« Reply #2 on: June 19, 2011, 04:58:30 AM »

Anytime you create, drop, or query a DB table from LotGD, you need to make sure you include db_prefix(); because some users will have a prefix for their tables. Just follow the updates below. EDIT, the first statement is from lib/changelog.php and the second is from modules/changelog.php.

Code:
<?php
// THIS
$sql "INSERT INTO `changelog` ( `id` , `date` , `title` , `desc` , `affected` ) VALUES (NULL ,'".date("Y-m-d")."', '".$title."', '".$desc."', '".$affected."')";
// AND THIS
$sql "SELECT * FROM changelog ORDER BY id DESC";
// SHOULD BE
$sql "INSERT INTO `".db_prefix("changelog")."` ( `id` , `date` , `title` , `desc` , `affected` ) VALUES (NULL ,'".date("Y-m-d")."', '".$title."', '".$desc."', '".$affected."')";
// AND
$sql "SELECT * FROM ".db_prefix("changelog")." ORDER BY id DESC";

Ah, I will remember that next time Tongue I have never used a prefix before so I sensed no need for it myself. I will note to make the changes for any future module releases Smiley
Logged
Michelina
Militia
**
Offline Offline

Posts: 35


Some days being me just isn't worth it.


View Profile WWW
« Reply #3 on: June 19, 2012, 05:01:30 PM »

I dropped this modules into my site and its spitting out a

Parse error: syntax error, unexpected '{' in /home/********/public_html/modules/changelog.php on line 39

I am asking for assistance as to why this has occurred.

I followed the READ ME in the module and placed both pieces in the correct folders.
I even tried to the prefix to the SQL to see if that was a problem.. it did not help.
I manually have created the table in my SQL so that it would be able to hook.

So anything at all at this point would be great.
Logged

Don't you wish you were short like me?

AlteredState RPG


Stephen Kise
Codemeister
****
Offline Offline

Posts: 372



View Profile WWW
« Reply #4 on: June 19, 2012, 06:01:08 PM »

I dropped this modules into my site and its spitting out a

Parse error: syntax error, unexpected '{' in /home/********/public_html/modules/changelog.php on line 39

I am asking for assistance as to why this has occurred.

I followed the READ ME in the module and placed both pieces in the correct folders.
I even tried to the prefix to the SQL to see if that was a problem.. it did not help.
I manually have created the table in my SQL so that it would be able to hook.

So anything at all at this point would be great.

When you have a syntax error, it just means that there is a typo or something is missing. In this case, find line 39:
Code:
<?php
if (
db_table_exists(db_prefix("changelog")){
?>

Change it to:
Code:
<?php
if (
db_table_exists(db_prefix("changelog"))){
?>

Then save the code. Putting the fixed version up in this attachment.
Logged
Michelina
Militia
**
Offline Offline

Posts: 35


Some days being me just isn't worth it.


View Profile WWW
« Reply #5 on: June 19, 2012, 06:32:54 PM »

Thanks for the fix.
It is working now.

Thank you Stephen!
Logged

Don't you wish you were short like me?

AlteredState RPG


Stephen Kise
Codemeister
****
Offline Offline

Posts: 372



View Profile WWW
« Reply #6 on: June 19, 2012, 06:34:49 PM »

Thanks for the fix.
It is working now.

Thank you Stephen!

Welcome.
Logged
Srch
Captain of the Guard
***
Offline Offline

Posts: 133

Hi, I'm Ver!


View Profile
« Reply #7 on: September 14, 2012, 09:53:31 AM »

Cleaned up my messy code. Added pagination, because it seems that making 200 changelog entries is not hard at all.
Logged

~Ender~
Captain of the Guard
***
Offline Offline

Posts: 185


Google is our savior!


View Profile
« Reply #8 on: December 30, 2012, 08:26:54 PM »

I installed the module and started adding things; however, instead of the added text showing up under 'View Changelog' it is showing up under the news. Pictures included.


Logged

insert sympathy here

Message me!
Eclypse ~ Xpert
Militia
**
Offline Offline

Posts: 75


View Profile
« Reply #9 on: December 30, 2012, 09:28:49 PM »

You didn't place the lib file into the lib folder where all the core files are.
Logged

Senior Administrator, Coder, and Head of Staff

tynastera.com
isleofdarkness.com
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
$100 raised this year
Your help is greatly appreciated!
Who's Online
28 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search