Welcome to Geeklog, Anonymous Tuesday, July 23 2024 @ 11:11 pm EDT

Geeklog Forums

Events Submission


Anonymous

Anonymous
Is there any way to see who the author of an event submission was before approving it? Currently when an event is submitted, if you as an admin click on edit to see who the author was, it just lists the admin and the author.
 Quote

Status: offline

rawdata

Forum User
Full Member
Registered: 02/17/03
Posts: 236
There really isn't any room on the event submission list unless something is removed or combined. So, this hack will display the submitter's name in the event editor instead. I don't like altering core tables at all, but I think this is the easiest way to implement what you want to do. (**Dirk cringes right about now**) This will entail modifying one table and three files. Step 1: *** Very Important *** Back up your gl_eventsubmission table. Also, back up these three files: <path to your public_html>/submit.php, <path to your public_html>/admin/event.php, and <path to your theme>/admin/event/eventeditor.thtml. This will allow you to easily back out of this hack if you encounter any problems. Step 2: Run this SQL statement in phpmyadmin (or whatever you use to edit your database) to add one additional field to the gl_eventsubmission table. If your table has a different prefix, change this ALTER statement so it accurately reflects your table's name. ALTER TABLE gl_eventsubmission ADD username char(16) DEFAULT NULL; Step 3: Go to the function savesubmission located inside submit.php. Find this line of code in the function (line 510): global $_TABLES, $LANG12, $_USER, $REMOTE_ADDR, $_CONF; Replace it with this one: global $_TABLES, $LANG12, $_USER, $REMOTE_ADDR, $_CONF, $LANG01; Find this section of code in the function (starts at line 626): if ($A['calendar_type'] == 'master') { if (($_CONF['eventsubmission'] == 1) && !SEC_hasRights('event.submit')) { $result = DB_save($_TABLES['eventsubmission'],'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location, address1,address2,city,state,zipcode,description',"{$A['eid']},'{$A['title']}','{$A['event_type']}', '{$A['url']}','{$A['datestart']}','{$A['timestart']}','{$A['dateend']}','{$A['timeend']}',{$A['allday']}, '{$A['location']}','{$A['address1']}','{$A['address2']}', '{$A['city']}','{$A['state']}','{$A['zipcode']}', '{$A['description']}'",$_CONF['site_url']."/index.php?msg=4"Wink; Replace it with this (be careful not to touch any other lines surrounding it): if ($A['calendar_type'] == 'master') { if (($_CONF['eventsubmission'] == 1) && !SEC_hasRights('event.submit')) { $username = $_USER['username']; if (empty($username)) { $username = $LANG01[24]; } $result = DB_save($_TABLES['eventsubmission'],'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location, address1,address2,city,state,zipcode,description,username',"{$A['eid']},'{$A['title']}', '{$A['event_type']}','{$A['url']}','{$A['datestart']}','{$A['timestart']}','{$A['dateend']}','{$A['timeend']}',{$A['allday']}, '{$A['location']}','{$A['address1']}','{$A['address2']}','{$A['city']}','{$A['state']}', '{$A['zipcode']}','{$A['description']}','$username'",$_CONF['site_url']."/index.php?msg=4"Wink; Step 4: Go to the function editevent located inside admin/event.php. Find this line of code in the function (line 71): global $_TABLES, $LANG30, $LANG22, $_CONF, $LANG_ACCESS, $_USER, $LANG12, $_STATES; Replace it with this one: global $_TABLES, $LANG30, $LANG22, $_CONF, $LANG_ACCESS, $_USER, $LANG12, $_STATES, $LANG01; Find this line in the function (line 111): $event_templates->set_var('event_id', $A['eid']); Insert these two lines right after it: $event_templates->set_var('lang_username', $LANG01[21]); $event_templates->set_var('event_submitter', $A['username']); Step 5: Inside admin/event/eventeditor.thtml template, add this row to the top of the table so the submitter's name will appear above the event title. <tr> <td align="right"><b>{lang_username}:</b></td> <td align="left"><b>{event_submitter}</b></td> </tr> That's it. When someone submits an event for moderation, his username will now be saved and then later displayed when you edit the event in the submission queue. Those without usernames will be added as Anonymous (or whatever you labeled them as in the language file). Any submissions in queue right now obviously won't have submitter names but subsequent ones will. These names are not carried over to the events table after saving. If you would like to see this particular feature added to the core code, you can always submit a feature request here: http://sourceforge.net/tracker/?atid=357371&group_id=7371&func=browse
 Quote

All times are EDT. The time is now 11:11 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content