PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2008-05-17 10:00:40

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

User Diaries 1.1

Code:

##
##        Mod title:  User Diaries
##
##      Mod version:  1.1.0
##   Works on PunBB:  1.2.*
##     Release date:  2008-05-17
##           Author:  Koos (pampoen10@yahoo.com)
##
##      Description:  Allows users to post diaries with images.
##
##   Affected files:  none
##                                     
##       Affects DB:  New tables:
##                       'diary'
##                       'diary_perms'
##                       'diary_reports'
## 
##            Notes:  Requires the GD library on your Web server. Script can
##                    upload JPEG, PNG AND GIF images.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
################################################################################
## CHANGELOG:
## 1.1.0 : can now edit your diary entries
##         added BBCode functionality
## 1.0.1 : some minor fixes and improvements
##         made changes to the English lang file
## 1.0   : initial release 
################################################################################

Download here

Offline

 

#2 2008-05-17 10:01:27

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

New in this release:
*Can now edit your diary entries. RSS will be updated accordingly
*Many people have asked me for BBCode functionality - so I decided to add it in this release. You can also enable/disable it in the settings. Note that you won't be able to use img, quote or code tags.

Other features:
* All pages valid XHTML strict
* Valid RSS 2.0 feed for all user diaries
* Can upload images with diary entries
* Easy to install and uninstall
* Users can report diary entries
* Permission control
* Diary statistics for admin

Last edited by Koos (2008-05-17 10:29:27)

Offline

 

#3 2008-05-17 20:50:02

doki
Member
Registered: 2007-04-30
Posts: 149

Re: User Diaries 1.1

nice update... By the way koos... There's no option on the edit page to delete the uploaded picture.

Waiting for the following features on the next release :)

- Users can add comments
- upload multiple images


thanks

Last edited by doki (2008-05-17 21:43:56)

Offline

 

#4 2008-05-18 08:14:26

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

I can't think why it would be useful to have the 'delete image' feature on the edit page. If you really want to make this change to an entry - you can just copy the text into a new entry - and delete the old one.

Also: I won't be adding the capability to upload multiple images. The idea of the diary is to only show one image per entry - with its associated comments. You can always separately upload multiple images as separate entries.

Last edited by Koos (2008-05-18 08:14:40)

Offline

 

#5 2008-07-16 11:53:17

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

User Diaries v1.1.1 now available. There was a bug to fix on the diary edit page. Also make a change in how the small envelope shown next to the diary poster's name is displayed. Now it will display correctly in all style sheets.

Offline

 

#6 2008-08-01 00:31:43

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

User Diaries v1.1.2 now available.

Changes made:

(1)I recently discovered that some security fixes were made in the parser of punbb/fluxbb - and had to make the same fixes in the parser of this mod.

(2)Added some code to validate BBCode syntax when submitting an entry.

(3)Can now select in the admin control panel whether diary entries should be displayed in a box or not.

Offline

 

#7 2008-08-09 07:29:02

doki
Member
Registered: 2007-04-30
Posts: 149

Re: User Diaries 1.1

Hi Koos,

How can i call the summary of diary outside the diary page like i will place it on index.php

thanks

Offline

 

#8 2008-08-09 09:09:14

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

Give me an idea of how you want it to be displayed, and then I'll see what I can come up with.

Offline

 

#9 2008-08-09 10:31:50

doki
Member
Registered: 2007-04-30
Posts: 149

Re: User Diaries 1.1

Thanks for the reply. Please refer to the pic below. I want to show the list of submitted diary entry ( latest 5 entry) with thumbnail to the index.php page or any other pages on the site as shown on the image below. I hope you can help me on this... Thanks a lot koos.

http://img227.imageshack.us/img227/1327/summaryml9.jpg

Last edited by doki (2008-08-09 10:33:35)

Offline

 

#10 2008-08-14 15:29:28

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

Hi Doki. I have created a diary_extern.php file for you - which should be uploaded to the forum root.

You can include it on the index.php page (or any other page) with:

Code:

// Load the diary extern module
require PUN_ROOT.'diary_extern.php';

Download diary extern

Last edited by Koos (2008-08-15 11:13:21)

Offline

 

#11 2008-08-14 16:29:12

doki
Member
Registered: 2007-04-30
Posts: 149

Re: User Diaries 1.1

Thanks koos... It works like a charm... Thanks for your support...

By the way one more thing. I'm getting a redeclare errors when I try to put it on /include/user/diary_sum.php .... I'm planning to put it on pun include so that i can insert it on templates.

my diary_sum.php (pun include)

Code:

 <?php
// Load the diary extern module
require PUN_ROOT.'diary_extern.php';
?>

thanks again...

Last edited by doki (2008-08-14 16:30:20)

Offline

 

#12 2008-08-15 11:30:33

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

The problem is with the parser. I have updated the diary_extern page above. If you are going to call the diary_extern with pun_include in a template, you will need to make the following change in viewtopic.php, and any other page that calls the parser:

Code:

#
#---------[ 1. FIND ]---------------------------------------------
#

require PUN_ROOT.'include/parser.php';


#
#---------[ 2. REPLACE WITH ]-------------------------------------
#

if (!function_exists('preparse_bbcode'))
    require PUN_ROOT.'include/parser.php';

Offline

 

#13 2008-08-15 11:38:26

doki
Member
Registered: 2007-04-30
Posts: 149

Re: User Diaries 1.1

Thanks a lot. I'll try it out...

Last edited by doki (2008-08-15 11:55:19)

Offline

 

#14 2008-08-15 13:18:32

doki
Member
Registered: 2007-04-30
Posts: 149

Re: User Diaries 1.1

koos its working now including the pun include stuff... I've change it a little to fit on my site... Thanks a lot for your help and for your great mods.

http://img365.imageshack.us/img365/9352/externzg0.png

Last edited by doki (2008-08-15 13:19:36)

Offline

 

#15 2008-11-27 01:58:29

jaason
Member
From: Poland
Registered: 2008-11-26
Posts: 30
Website

Re: User Diaries 1.1

Hi. I have problem with installation on postgreSQL.

after changing installation queries to looks like this (deafult doesn't work):

$sql = 'CREATE TABLE '.$db->prefix."diary (
                    id serial NOT NULL,
                    poster character varying(200) NOT NULL DEFAULT '',
                    poster_id INTEGER NOT NULL DEFAULT 1,
                    poster_ip character varying(15),
                    message TEXT,
                    posted INTEGER  NOT NULL DEFAULT 0,
                    entry_date date NOT NULL,
                    image_ext character varying(10) NOT NULL DEFAULT '',
                    PRIMARY KEY (id)
                    );";
                   
            $sql2 = 'CREATE TABLE '.$db->prefix."diary_perms (
                    group_id integer NOT NULL DEFAULT 0,
                    post_entries     smallint NOT NULL DEFAULT 1,
                    post_images     smallint NOT NULL DEFAULT 1,
                    PRIMARY KEY (group_id)
                    ); ";
                   
            $sql3 = 'CREATE TABLE '.$db->prefix."diary_reports (
                    id serial NOT NULL ,
                    entry_id integer  NOT NULL DEFAULT 0,
                    poster_id integer  NOT NULL DEFAULT 0,
                    entry_year integer  NOT NULL DEFAULT 0,
                    reported_by integer  NOT NULL DEFAULT 0,
                    created integer  NOT NULL DEFAULT 0,
                    message TEXT,
                    zapped integer,
                    zapped_by integer,
                    PRIMARY KEY (id)
                    );";

I have another problem, with function year, which doesn't exist in postgre. I've tried to rename  all year(name) to onyl name but it gives an error:
[img=http://img155.imageshack.us/img155/2500/errorje6.th.jpg]
what should I do?

Offline

 

#16 2008-11-27 11:34:39

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

I am not very familiar with postgre, but try replacing year(name) with extract(year FROM date(name))

Offline

 

#17 2008-11-28 00:09:33

jaason
Member
From: Poland
Registered: 2008-11-26
Posts: 30
Website

Re: User Diaries 1.1

ok thx it's working, but I have another problem which I can't resolve:

error message:

File: /diary.php
Line: 970

PunBB reported: Unable to fetch diary submission list for forum

Database reported: ERROR: column "r.id" must appear in the GROUP BY clause or be used in an aggregate function

Failed query: SELECT r.id, r.poster, r.poster_id, r.poster_ip, r.message, max(r.posted) as max_posted, r.entry_date, r.image_ext, u.username, u.location FROM zzpun_diary as r LEFT JOIN zzpun_users AS u ON r.poster_id=u.id WHERE extract(year FROM entry_date) = 2008 GROUP BY poster_id ORDER BY max_posted DESC

I've tried to use GROUP BY before LEFT JOIN but it's not working...
do You have any idea what's wrong?

Offline

 

#18 2008-11-30 02:43:56

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

I don't have a way of testing it, but try using:

Code:

SELECT r.id, r.poster, r.poster_id, r.poster_ip, r.message, max(r.posted) as max_posted, r.entry_date, r.image_ext, u.username, u.location 
FROM zzpun_diary r 
LEFT JOIN zzpun_users u ON r.poster_id=u.id 
WHERE extract(year FROM r.entry_date) = 2008 
GROUP BY r.poster_id 
ORDER BY max_posted DESC

Offline

 

#19 2008-12-01 05:14:29

jaason
Member
From: Poland
Registered: 2008-11-26
Posts: 30
Website

Re: User Diaries 1.1

thanks for You reply. I've tried on my own to change some things and it's already working, tommorow I'll add PostgreSQL version for this mod, and of course polish translation for it.

one more thing: is it possible to change the list which of diaries which looking like this http://img84.imageshack.us/my.php?image=rssmj5.jpg
to look like this: http://img152.imageshack.us/my.php?image=rss2vt1.jpg

I mean to group all the entries from one user into one link...?

Last edited by jaason (2008-12-01 06:34:56)

Offline

 

#20 2008-12-01 09:30:02

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

I think you must have made a mistake somewhere when you modified the queries to be compatible with postgreSQL. The way it is supposed to look is like this:
http://img152.imageshack.us/my.php?image=rss2vt1.jpg

Offline

 

#21 2008-12-02 02:56:13

jaason
Member
From: Poland
Registered: 2008-11-26
Posts: 30
Website

Re: User Diaries 1.1

fixed ;]
here You've got:

- User Diaries 1.1.2 for PostgreSQL
- Polish translation for User Diaries 1.1.2
- Polish translation for User Online 1.1.1

it will be good if You have chance to check PostgreSQL installation before. It works fine for me, but I want to be sure that it will work for everybody.

Offline

 

#22 2008-12-04 12:18:25

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

Thanks jaason, that's great! I will test it in PostgreSQL myself when I get a chance.

Offline

 

#23 2009-03-24 06:40:46

jaason
Member
From: Poland
Registered: 2008-11-26
Posts: 30
Website

Re: User Diaries 1.1

hi again
maybe You'll know what to do with that...

everything was working fine 'till today tongue

now when I'm trying to add a new diary post without a picture it's returning me an error:

File: /usr/local/apache2/htdocs/brama/forum/diary_submit.php
Line: 224

PunBB reported: Unable to insert into diary

Database reported: ERROR: current transaction is aborted, commands ignored until end of transaction block

Failed query: INSERT INTO pun_diary (poster, poster_id, poster_ip, message, posted, entry_date, image_ext) VALUES('jaason', 849, '192.168.1.220', '435567', 1237901731, '2009-3-24', '')

I've test the query but it's working... I don't know what cause the problem...

Offline

 

#24 2009-03-25 13:39:47

Koos
Member
Registered: 2007-01-14
Posts: 336
Website

Re: User Diaries 1.1

Hi jaason. Is the rest of your forum working ok? It's going to be a bit difficult for me to look for the problem, since I don't have postgreSQL installed. Have you made any modifications/changes just before you started getting this error? Or maybe your host made some changes/updates.

Last edited by Koos (2009-03-25 13:40:04)

Offline

 

#25 2009-03-26 02:09:01

jaason
Member
From: Poland
Registered: 2008-11-26
Posts: 30
Website

Re: User Diaries 1.1

hey. rest forum working fine.. I convert User Diaries to PostgreSQL (4 posts up info about that), everything was doing just fine, but someday it's stops:P

ok I think I know the solution... maybe is it possible to add there or remove some function which is checking the extension or whole picture is it added or not.??? I know that only extension is added into database, so how diary knows which picture is going to specific post?
like I said, script return error only when i DO NOT add the picture ...
I tried to find some INSERT in diary_submit.php  which add this into base, but I found 2 or 3 ( I don't remember now) INSERT's there...and got confused...
maybe You can tell me in which line I should to turn off, or maybe I will change it to add some blank little picture if nothing added...but don't know where and how is working:P

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.