Script URL:www.selectsmallhotels.com/support/index.php
Version of script: 2.0
Write your message below:
Is there any way to preload the Category when linking into the page:
.../index.php?a=add
I want to use the system as a communications tool so clients can contact any of the member hotels and it would lessen confusion if I could add the category into the link off each hotel's contact page.
Cheers,
Andrew
Preload Category
Moderator: mkoch227
Try editing the index.php file (the one in the main Hesk folder) - open it in Notepad, find lines 156-157 which say .
Just below the <?php paste this code:
Then you should be able to use something like this to have a default category selected:
.../index.php?a=add&catid=123
where 123 is the category ID you want selected.
You can find category ids for example in the admin panel under "Categories" by looking in the URL linked to arrow images that are used to move categories up and down (catid parameter in the URL).
Code: Select all
<td width="80%"><select name="category">
<?php
Just below the <?php paste this code:
Code: Select all
if (!isset($_SESSION['c_category']))
{
if (!empty($_GET['catid']))
{
$_SESSION['c_category'] = intval($_GET['catid']);
}
}
.../index.php?a=add&catid=123
where 123 is the category ID you want selected.
You can find category ids for example in the admin panel under "Categories" by looking in the URL linked to arrow images that are used to move categories up and down (catid parameter in the URL).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Preload Category
Works perfectly, thanks
Andrew
Andrew
Script URL:www.selectsmallhotels.com/support/index.php
Version of script: 2.1
With reference to this code change to preload the category - it worked great in 2.0, when I upgraded to 2.1 today, I added the same code into the index.php file in 2.1 but it doesn't work - it seemed to work the first time I clicked on a link but now it just stays on that category, it doesn't change to the right category as per the catid number in the link.
I added the code after line 165 in the index.php file of version 2.1
Any ideas?
Thanks,
Andrew
Version of script: 2.1
With reference to this code change to preload the category - it worked great in 2.0, when I upgraded to 2.1 today, I added the same code into the index.php file in 2.1 but it doesn't work - it seemed to work the first time I clicked on a link but now it just stays on that category, it doesn't change to the right category as per the catid number in the link.
I added the code after line 165 in the index.php file of version 2.1
Any ideas?
Thanks,
Andrew
It does work, but the HESK remembers the choice for the session (if you close all browser windows and try it again it will work again).
To change it every time you can try using this code instead:
To change it every time you can try using this code instead:
Code: Select all
if (!empty($_GET['catid']))
{
$_SESSION['c_category'] = intval($_GET['catid']);
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Category ID
Thanks Klemen,
I'll try that code.
Cheers,
Andrew
I'll try that code.
Cheers,
Andrew