Property and IDs

Help with installation and general calendar setttings

Property and IDs

Postby danbug » Sun Feb 20, 2011 4:28 am

Hello...

I wonder if anyone can help me. In order to show the correct calendar I am using the following method I create an iframe which open the index.php with a variable index.php?ac=2

var id_item = '<?php echo $_GET['ac'] ?>'; // id of item to be modified (via ajax)

Now I would like to create a basic PHP page that lists all the ids for all the calendars I have. Just likes what happens in the drop down menu but in text form

So would look like:

ID Description
1 Blue House
2 Red House
3 Yellow House

etc etc etc - any help would be greatly appreciated!

DanBug
danbug
 
Posts: 4
Joined: Mon Oct 11, 2010 5:48 pm

Re: Property and IDs

Postby chris » Mon Feb 21, 2011 2:49 pm

Hi
Is this to be shown in the admin panel?

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Property and IDs

Postby danbug » Mon Feb 21, 2011 8:23 pm

Hi Chris,

Doesn't Make a difference really even an external page will do... obviously in the admin panel would be sleakier. But a simple page with an sql query would do. The things is that is easy to loose track of which calendar is which when you start deleting some of them.

Thanks for your help

Daniel
danbug
 
Posts: 4
Joined: Mon Oct 11, 2010 5:48 pm

Re: Property and IDs

Postby chris » Mon Feb 21, 2011 8:54 pm

Hi,
It does make a difference to the solution ;)
If this is in admin you can simply add this to the list of calendar items using the code that is already there. However, if you want some sort of "external" list (for public viewing) you will need to create new code.

So, assuming that it is "just" for admin, open the ac-admin/items.admin.php file.
Find this line (ln 165):
Code: Select all
<td>'.$row["username"].'</td>

and add this before it:
Code: Select all
<td>'.$row["id"].'</td>

Then, further down find this line (184):
Code: Select all
<td style="width:160px;">'.$lang["username"].'</td>

And add this line before it:
Code: Select all
<td class="id">ID</td>

That should be enough to add the id to the list of calendar items.
Let me know how it goes or if you have any problems following that.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Property and IDs

Postby danbug » Mon Feb 21, 2011 9:54 pm

Simply perfect Chris!...

I am currently trying to integrate it to Wordpress and thus far managed to create a shortcode that calls an iframe and the missing link was the ID as you need to define the ID for the correct calendar to show up.

I was trying to think if it can be done as a widget but I think it needs to be a script as it needs to be able to add the includes at the top of the page and that is way too complicated for me :D so this will be perfect.

I was thinking... maybe if somehow I could manually change the item ID I could set it to match the post ID and therefore the shortcode wouldn't need to have any elements defined as it would take the post id number as a variable... but that's just me fantasizing and showing how little I know about mysql :P

Thanks a million

Daniel
danbug
 
Posts: 4
Joined: Mon Oct 11, 2010 5:48 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron