vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Calendar Search and Comments for Events (https://vborg.vbsupport.ru/showthread.php?t=78210)

deathemperor 03-15-2005 10:00 PM

Calendar Search and Comments for Events
 
This hack I made was a paid request by Lee Wilde, the thread can be found here: https://vborg.vbsupport.ru/showthread.php?t=74337 . He and I want to release this to public because Lee Wilde believed that there're alot of members looking for this.

*UPDATE: 03/28/2005

If you installed this hack before 03/28/2005, to fix search bugs please rehack the file calendar.php


*UPDATE: 03/23/2005

Fixed 2 table_prefix mistaken, please read this post: https://vborg.vbsupport.ru/showpost....0&postcount=38

*UPDATE: 03/17/2005 fixed avatar disable problem and a minor wrong in instructions.txt

TO FIX avatar disable:

FIND:

PHP Code:

SELECT eventcomments.*, event.lastevecomdateline,user.*,userfield.*,usertextfield.signature customavatar.dateline AS avatardateline FROM " . TABLE_PREFIX . "eventcomments AS eventcomments 

REPLACE WITH:

PHP Code:

SELECT eventcomments.*, event.lastevecomdateline,user.*,userfield.*,usertextfield.signature " . iif($vboptions['avatarenabled'], "customavatar.dateline AS avatardateline") . " FROM " . TABLE_PREFIX . "eventcomments AS eventcomments 




What does this hack do ?

Give your users ability to search for Events on Calendar.
Ability to add comments for events.

The permission is usergroup based:
  • Viewing permission.
  • Post Comments.
  • Edit Own comments.
  • Edit Others comments.
  • Delete Own comments.
  • Delete Other comments.
  • Search Events.


Files edit: 3
New Template: 7
Templates Edit:1
Database: 1 new table, 2 new column for table 'event'.

Installation time: less than 10 minutes.

Screenshots: (thanks to Lee Wilde).

Search Events: https://vborg.vbsupport.ru/attachmen...chmentid=24795

event_with_quickreply_enabled : https://vborg.vbsupport.ru/attachmen...chmentid=24793
event_with_reply_added : https://vborg.vbsupport.ru/attachmen...chmentid=24794

Credits: The installer I use is from V3 Article with permission from John so the credit goes to him.

Last words: I will try to help with all the problems *in cases* may occur.

nexialys 03-16-2005 12:00 PM

hum.. comments on events, does this mean it works like a "new thread for each event", so people doesn't have to create new threads for each event ?! this is great!

EDIT: found a first error;

in the instructions, the first thing is not to ADD BELOW, but to REPLACE WITH in the "in includes/init.php find..."

EDIT AGAIN:

script look solid, but you're not using $vbphrase ... fix this and this will be my next Hack of the Month!!! (ok, we may find some other details to fix before that!)

Lizard King 03-16-2005 12:37 PM

Is there any screenshot or live demo ?

Polo 03-16-2005 12:49 PM

Yeah, some screenshots would be great...

Challenge 03-16-2005 02:33 PM

Yeah, great! Thanks for releasing!

Lionel 03-16-2005 08:52 PM

I wish I could see screenshots. What is the difference between this hack and that one

Lionel 03-16-2005 10:41 PM

Well, I installed. I had avatar disabled on my board, that gave me a mysql error. Could not go any further. Once I enabled avatar, it became fine. I don't want avatar.


Quote:

Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT eventcomments.*, event.lastevecomdateline,user.*,userfield.*,userte xtfield.signature , customavatar.dateline AS avatardateline FROM eventcomments AS eventcomments
LEFT JOIN event AS event ON(event.eventid=eventcomments.eventid)
LEFT JOIN user AS user ON(user.userid=eventcomments.evecomuserid)
LEFT JOIN userfield AS userfield ON(userfield.userid=eventcomments.evecomuserid)
LEFT JOIN usertextfield as usertextfield ON(usertextfield.userid=eventcomments.evecomuserid )

WHERE eventcomments.eventid=38
ORDER BY eventcomments.evecomid ASC
LIMIT 0, 10

mysql error: Unknown table 'customavatar' in field list

mysql error number: 1109

Lee Wilde 03-17-2005 01:12 AM

Ahem.....deathemperor.....I am a "she" not a "he".... lol

The hack worked perfectly for me on a development board. I'll be installing it on my live site today and I'll post a link here when its ready.

My site is a small business networking site. The ability for my members to add comments to events in the calendar will encourage them to discuss and arrange to meet at upcoming events.

deathemperor accomplished this hack for me with lightening speed and I did not experience any errors at all when installing....and my board had been hacked to death already. Given his knowledge, I'm sure any errors experienced by others will be able to be rectified without much fuss.

Excellent work deathemperor. I will try and contact some of the members who had been searching for the calendar search hack in particular, and alert them to this thread.

Lionel 03-17-2005 01:34 AM

Lee, out of curiosity do you have avatars enabled? Hack works perfect for me, until avatar is disabled...

Lee Wilde 03-17-2005 01:41 AM

Quote:

Originally Posted by Lionel
I wish I could see screenshots. What is the difference between this hack and that one

Lionel, the hack you linked to (New Thread on Calendar Event) creates a thread in a specified forum, whenever an event is added to the calendar.

deathemperor's hack enables users to reply directly to the event in the calendar....so the calendar event itself can become a thread!

This will bring our calendars to life!!

I'll post a link to a live example later today.

Lee Wilde 03-17-2005 01:43 AM

Quote:

Originally Posted by Lionel
Lee, out of curiosity do you have avatars enabled? Hack works perfect for me, until avatar is disabled...

Hi Lionel, yes I do have avatars enabled. I'm not a code guru. I'm sure when deathemperor sees your problem he will show you how to remedy.

Lionel 03-17-2005 01:44 AM

Thanks. I hope I am not the only one with that problem. Like you said, it brings life in calendar. It's just that avatar I'd like to keep disable.

Lee Wilde 03-17-2005 01:48 AM

Here are 2 screenshots.

1. event_with_quickreply_enabled.jpg
Users are used to seeing the quick reply box in the forums, so to see under an event seems natural.

2. event_with_reply_added.jpg
Once someone has replied to the event, it begins to look like a forum thread!

I will add a screenshot of the calendar search page shortly.

deathemperor 03-17-2005 02:28 AM

a minute I'll fix the avatar disable problem, didn't think of disabling avatar T_T

to fix avatar disable problem if you installed:

FIND:

PHP Code:

SELECT eventcomments.*, event.lastevecomdateline,user.*,userfield.*,usertextfield.signature customavatar.dateline AS avatardateline FROM " . TABLE_PREFIX . "eventcomments AS eventcomments 

REPLACE WITH:

PHP Code:

SELECT eventcomments.*, event.lastevecomdateline,user.*,userfield.*,usertextfield.signature " . iif($vboptions['avatarenabled'], "customavatar.dateline AS avatardateline") . " FROM " . TABLE_PREFIX . "eventcomments AS eventcomments 


BTW thanks for the kinds word Lee Wilde, much appriciate.

and the reason why I didn't add phase to this was I didn't have enough time, also this hack isn't really big enough

SamirDarji 03-17-2005 04:35 AM

This looks great! Any sceenshots of the search?

Lee Wilde 03-17-2005 04:38 AM

Screenshot of calendar search page.

Lizard King 03-17-2005 04:59 AM

Quote:

Originally Posted by Lee Wilde
Here are 2 screenshots.

1. event_with_quickreply_enabled.jpg
Users are used to seeing the quick reply box in the forums, so to see under an event seems natural.

2. event_with_reply_added.jpg
Once someone has replied to the event, it begins to look like a forum thread!

I will add a screenshot of the calendar search page shortly.

Lee do you have event attendence installed also ? And is this mod working together with event attendence ?

Lee Wilde 03-17-2005 05:05 AM

I used the event attendance hack on my previous setup and it was brilliant. I don't know whether I really need it now.

I guess the event attendance hack did create the cool list of who is going. Hmmm......perhaps I will install it again. I'll let you know if it causes any problems.

Lionel 03-17-2005 12:23 PM

That fixed my problem. Hack seems to work 100% ok. Indeed you've created a forum within the calendar. Great work!

Leeper 03-17-2005 01:54 PM

Quote:

Originally Posted by Lee Wilde
I used the event attendance hack on my previous setup and it was brilliant. I don't know whether I really need it now.

I guess the event attendance hack did create the cool list of who is going. Hmmm......perhaps I will install it again. I'll let you know if it causes any problems.

They work great together! Now I just want to figure out the right place to put the search feature. Outstanding hack! I've had it installed for less than an hour and already have compliments! Thank you *clicks install*

Lionel 03-17-2005 01:57 PM

I placed the search in the navbar under a drop down for calendar as a link. It would be nice to be able to use with vbaCMS. The old module does not recognize the events id

Leeper 03-17-2005 02:54 PM

hit a snag. My signature block comes up as code. Any ideas? Link

ChurchMedia 03-18-2005 02:54 AM

A couple of problems I'm having:

The avatar link is broken
The drop-down on the user name has some weird code in it
The signature is not recognizing line breaks
When trying to delete a comment I get:

Quote:

Invalid SQL: UPDATE event SET totalcom = totalcom - 1,lastevecomdateline= WHERE eventid=94
mysql error: You have an error in your SQL syntax near 'WHERE eventid=94' at line 1

mysql error number: 1064
Here is an example:
http://www.churchmedia.net/community...-4-19&e=94&c=4

deathemperor 03-18-2005 04:13 AM

Here the fix for the error when trying to delete comments:

in calendar.php find:

PHP Code:

$DB_site->query("DELETE FROM " TABLE_PREFIX "eventcomments WHERE evecomid=$id");
            
            
$lastevecom $DB_site->query_first("SELECT * FROM " TABLE_PREFIX "eventcomments ORDER BY evecomdateline DESC LIMIT 1");
            
$DB_site->query("UPDATE " TABLE_PREFIX "event SET totalcom = totalcom - 1,lastevecomdateline=$lastevecom[evecomdateline] WHERE eventid=$e"); 

REPLACE IT WITH:

PHP Code:

$DB_site->query("DELETE FROM " TABLE_PREFIX "eventcomments WHERE 

evecomid=
$id");
            
            
$lastevecom $DB_site->query_first("SELECT * FROM " TABLE_PREFIX 

"eventcomments ORDER BY evecomdateline DESC LIMIT 1");
            
$lastevequery '';
            if(
is_array($lastevecom) && !empty($lastevecom[evecomdateline]))
            {
                

$lastevequery=",lastevecomdateline=$lastevecom[evecomdateline]";
            }
            
$DB_site->query("UPDATE " TABLE_PREFIX "event SET totalcom = 

totalcom - 1 
$lastevequery WHERE eventid=$e"); 

let me know if it works, I am currently away from my PC so I can't do any deep fix. I'll fix the signature problem soon.

Thanks everyone very much for your kind words.

Lionel 03-18-2005 04:38 AM

Am I missing something? Do I need to apply that fix? I am able to delete comments, events no problems, so I am not sure if I should do it or not....

Lee Wilde 03-18-2005 04:53 AM

If it aint broke, don't fix it Lionel ;-)

We have all customised our forums in different ways, so we may experience different problems. So far the only problem I've seen on mine is the signature not displaying correctly, but deathemperor will provide a fix for that soon I'm sure.

deathemperor 03-18-2005 11:55 AM

Quote:

Originally Posted by Lionel
Am I missing something? Do I need to apply that fix? I am able to delete comments, events no problems, so I am not sure if I should do it or not....

that problem occurs when you have only one comment in an event, So I recommend anyone who installed this hack apply the fix.


SIGNATURE FIX: in calendar.php FIND:

PHP Code:

$eventcomment['evecombody'] = fetch_censored_text($eventcomment['evecombody']); 

ADD BELOW (actually it's possible to add above ^^):

PHP Code:

$eventcomment['signature'] = parse_bbcode($eventcomment['signature'], 01); 

zip updated.

Lionel 03-18-2005 06:54 PM

I did not have the delete problem under the conditions that you said. I updated and I got
Quote:

Database error in vBulletin 3.0.7:

Invalid SQL: UPDATE event SET totalcom =

totalcom - 1 ,lastevecomdateline=$lastevecom[evecomdateline] WHERE eventid=42
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 '[evecomdateline] WHERE eventid=42' at line 3

mysql error number: 1064
So I reverted and all is fine.

mysql database 4.03

deathemperor 03-19-2005 12:22 AM

I'm sorry, to fix that: find:

PHP Code:

$lastevequery=',lastevecomdateline=$lastevecom[evecomdateline]'

replace with:
PHP Code:

$lastevequery=",lastevecomdateline=$lastevecom[evecomdateline]"

updated fix post above.

Lionel 03-19-2005 01:57 AM

that works, thanks.

Reeve of shinra 03-22-2005 03:42 AM

Thank you for releasing this hack. In retrospect, I cant believe you cant search for calander events making this very much needed.

Reeve of shinra 03-22-2005 03:57 AM

Maybe I missed something but how does a user access the search?

deathemperor 03-22-2005 04:49 AM

you can use: http://YOURSITE.com/FORUM/calendar.php?do=search for the link to event search.

Reeve of shinra 03-22-2005 05:13 AM

When I try that, I get a user not allowed permissions error. I went into the admincp and for admin, the search calender option is set to 'yes'. I probably typo'd something... i'll have to check the code edits when im more awake.

deathemperor 03-22-2005 05:35 AM

it may be because you have not 'save' the usergroup permission in the first time so that it takes effect. I believe the code is ok since ppl is searching finely.

Reeve of shinra 03-22-2005 05:46 AM

Ah that was it. I knew it had to be something simple lol

Thanks!

MikaK 03-23-2005 07:12 AM

Installed this on a 303 with event attendance. All went fine, but when trying to add a comment or quote a existing comment this error pops up (the comments get added into the db all ok):

Quote:

Database error in vBulletin 3.0.3:
Invalid SQL: SELECT * FROM eventcomments WHERE eventid=12
mysql error: Table 'soundchi_loudlounge.eventcomments' doesn't exist
mysql error number: 1146
Date: Wednesday 23rd of March 2005 12:45:51 AM
Script: http://www.soundchilds.net/loud_lounge/calendar.php
Referer: http://www.soundchilds.net/loud_loun...newevecom&e=12
Username: MikaK
IP Address: xxx
my table is using a prefix 'scll' so it should be sclleventcomments.

Certainly hope there is a fix around for the mysql error. This is one hell of a handy hack:banana:

Regs,
-Mika

deathemperor 03-23-2005 02:36 PM

OOPS !

my bad mistake, I missed 2 table_prefix.

TO FIX:

IN calendar.php FIND:

PHP Code:

    // calculating which page the comment edited or posted is in
    
$perpage $vboptions['evecomperpage'];
    
$countq $DB_site->query("SELECT * FROM eventcomments WHERE eventid=$e");
    
$evecomcount $DB_site->num_rows($countq);
    
$evepage ceil($evecomcount/$perpage);
    
// query the newest comment
    
$thisevecom $DB_site->query_first("SELECT evecomid FROM eventcomments WHERE evecomtitle = '" addslashes($title) . "' ORDER BY evecomdateline DESC LIMIT 1");
    
$url "calendar.php?$session[sessionurl]do=getinfo&e=$e&page=$evepage#comment$thisevecom[evecomid]";
    eval(
print_standard_redirect('redirect_postthanks'));


REPLACE WITH:

PHP Code:

    // calculating which page the comment edited or posted is in
    
$perpage $vboptions['evecomperpage'];
    
$countq $DB_site->query("SELECT * FROM " TABLE_PREFIX "eventcomments WHERE eventid=$e");
    
$evecomcount $DB_site->num_rows($countq);
    
$evepage ceil($evecomcount/$perpage);
    
// query the newest comment
    
$thisevecom $DB_site->query_first("SELECT evecomid FROM " TABLE_PREFIX "eventcomments WHERE evecomtitle = '" addslashes($title) . "' ORDER BY evecomdateline DESC LIMIT 1");
    
$url "calendar.php?$session[sessionurl]do=getinfo&e=$e&page=$evepage#comment$thisevecom[evecomid]";
    eval(
print_standard_redirect('redirect_postthanks'));


zip updated.

MikaK 03-23-2005 03:02 PM

Quote:

Originally Posted by deathemperor
OOPS !

my bad mistake, I missed 2 table_prefix.

Worked like a treat:) Tnx.

deathemperor 03-23-2005 04:29 PM

no prob.

I'm glad to hear that.


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01471 seconds
  • Memory Usage 1,882KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete