The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Where are calendars created?
Hello everyone, I was wondering if anyone knew by any chance where i could find how calendars are created (after saving through admin panel), I ask because I have successfully created a new calendar with a SQL query to add the record in the "calendar" table ; I even see the new calendar in the admin panel and I can edit it's settings but I can't view it nor it appears on the "Calender Picker" drop down menu from the forums. If I try and view it from the admin panel I get a invalid permissions page so I'm guessing it's not as direct as a simple SQL query, I image there's some permissions that need to be updated somewhere?? I checked my own permissions and I am able to view all other calendars except that one. Any9one have any ideas what I could be missing?
The idea I have is the following... I want to have a calendar on the home page of my mod that updates weekly according to what the moderator of the mod inserts (events). I was able to embed the calendar successfully in my page and had the permissions changed so that everyone can view this calendar with the events that the "chosen" moderator places. At the same time the calendar will be updated every time the cron file runs at whatever time the moderator places the event. I am half way there... The calendar appears successfully and permissions are correct to view. I have also been able to have the back-end for the moderator created for him/her to add events and no one else (another option is added for the admin to provide the user id of the contest moderator(s)) and this is used within the calendar code; meaning everyone who views this page the calendar assumes it's user_id x and views only the events we control. Next step would be creating the code for the creation of the calendar (initially when the mod installs; this is my initial question for this thread ). After that it's a matter of syncing the cron and the events and voil?... Got a bit of track there so about that everyone. Needed to vent my thoughts a bit. Any way if anyone has any ideas or thoughts about how to create a new calendar with proper permisisons please don't be shy. Sharing is caring everyone, specially knowledge. Thanks for your time everyone. Please let me know your thoughts. Have a good night everyone. Best Regards. |
#2
|
|||
|
|||
Calendars are created in admincalendar.php. The saving portion is just an sql that parses the data from the routine in admincalendar.php.
By default, calendar permissions are empty (as in no permissions exist for a calendar) which allows all members all access and that information is held in the calendarpermission table as a bitfield total. So I don't think that's the problem unless you wrote something to that table for that calendar. You may not have set all of the fields in the calendar and that might be a problem. Also, you need to be careful because at least one of the fields is a bitfield total. And another is an array definition for emails (not just an array of emails). |
#3
|
|||
|
|||
Quote:
PHP Code:
|
#4
|
|||
|
|||
Ok, something to keep in mind, you NEVER assign a value to the first field in any table (in this case, calendarid). You don't even specify it in your save SQL. That field auto-increments and should never be assigned a value in any query that adds a record to the table.
The save routine IS this.. Code:
$db->query_write(fetch_query_sql($vbulletin->GPC['calendar'], 'calendar')); If you just duplicated an existing calendar that you can view (with a different name I hope), there's no reason why it shouldn't work. So far as that code, it's not really needed if you write directly to the table with known values. --------------- Added [DATE]1313587108[/DATE] at [TIME]1313587108[/TIME] --------------- Just to be sure I'm not talking out of my hind end, I just added a calendar with all of the same settings as the default calendar on my dev server by a direct SQL add and it does work. The only settings I changed were the calendar name, and the display order. |
#5
|
|||
|
|||
Quote:
PHP Code:
What comes to mind creating the calendar, setting a custom name for it "Contest Of The Week" then use that name to get the calendar id to display it in my page with the code I have now which all I have to specify is which calendar id it is. Thank you so much for your help nhawk. Can't wait for you to see what all this works been about I think people are really going to enjoy this. There's nothing out there right now like it, as far as I know anyway. UPDATE: The SQL works perfect. I just used the id of the calendar in my page to show the new calendar I created with the SQL query and it shows fine, for me and everyone else! Thanks again. --------------- Added [DATE]1313591950[/DATE] at [TIME]1313591950[/TIME] --------------- Using this to add events: PHP Code:
PHP Code:
|
Благодарность от: | ||
nhawk |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|