Your ultimate PunBB resource!
You are not logged in.
## ## 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 ################################################################################
Offline
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
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
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
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
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
Hi Koos,
How can i call the summary of diary outside the diary page like i will place it on index.php
thanks
Offline
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.
Last edited by doki (2008-08-09 10:33:35)
Offline
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:
// Load the diary extern module require PUN_ROOT.'diary_extern.php';
Last edited by Koos (2008-08-15 11:13:21)
Offline
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)
<?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
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:
#
#---------[ 1. FIND ]---------------------------------------------
#
require PUN_ROOT.'include/parser.php';
#
#---------[ 2. REPLACE WITH ]-------------------------------------
#
if (!function_exists('preparse_bbcode'))
require PUN_ROOT.'include/parser.php';Offline
Thanks a lot. I'll try it out...
Last edited by doki (2008-08-15 11:55:19)
Offline
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.
Last edited by doki (2008-08-15 13:19:36)
Offline
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
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
I don't have a way of testing it, but try using:
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
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
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
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
hi again
maybe You'll know what to do with that...
everything was working fine 'till today ![]()
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
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
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