Kayako logo
SupportSuite, eSupport and LiveResponse Discussion, troubleshooting and feedback related to Kayako's flagship support desk products SupportSuite, eSupport and LiveResponse.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1) Old
edski Offline
New Member
 
Posts: 6
Join Date: Jun 2006
News on home page - 01-06-2006, 08:32 AM

Hiya i wondered if anyone could help me, i have a small news box on my homepage and i would like the articles to be listed in there from my kayako news folder. How can i go about doing this?

regards
Edski
   
Reply With Quote
  (#2) Old
edski Offline
New Member
 
Posts: 6
Join Date: Jun 2006
01-06-2006, 09:58 AM

no probs now i managed to code myself one up, hehehe not bad saying i dont know much about php.

If anyone would like it let me know and i'll post it.
   
Reply With Quote
  (#3) Old
Hawkwing Offline
Member
 
Posts: 100
Join Date: Oct 2005
01-06-2006, 10:02 AM

Quote:
Originally Posted by edski
no probs now i managed to code myself one up, hehehe not bad saying i dont know much about php.

If anyone would like it let me know and i'll post it.
I would like to know how you did this. please post it.
   
Reply With Quote
  (#4) Old
edski Offline
New Member
 
Posts: 6
Join Date: Jun 2006
01-06-2006, 10:14 AM

basically i created 2 files, one to query the database :-
Code:
<?php

// The following constants define the username, password, host and database.
// Edit as needed
define ('DB_USER', 'username'); // Database Username
define ('DB_PASSWORD', 'password);  // Database Password
define ('DB_HOST', 'localhost');     // Server, will be 'localhost' 99% of the time
define ('DB_NAME', 'database_kayako'); // Database Name

// Do Not Edit below this line
#########################################

// Connect to MySQL
$dbc=mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) or die ('I cannot connect to the database because: ' . mysql_error());

// Select the database
mysql_select_db (DB_NAME) or die ('I cannot select the database becuase: ' . mysql_error());

?>
i saved this as config.php

then i created the news.php which i would use an iframe in my main homepage to display

Code:
<html>
<head>
<link href="main.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#EFF3F7">

<?php

require_once ('config.php'); // connect to mysql and select the database

$sql = "SELECT newsid, subject, description FROM swnews ORDER BY newsid DESC ";

$result = mysql_query($sql) or die(mysql_error()); // Run the query, or print error message
?>
<table width="130" border="0" cellpadding="0" cellspacing="0" bgcolor="#EFF3F7" style="FSB">
  <tr>
  <td width="130" height="179" valign="top" wrap class="leftoptions"><?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { // Make results from the query into an array
echo "strong />$row[subject]</strong /><br />$row[description]"
."<br /><hr class=\"underline\" />\n"
."<br />\n";
}
?></td>
  </tr>
</table>

</body></html>
These files make references to my css file so you will need to edit to suit your own needs, im looking at adding a date in there as well. But like i said my knowledge is very limited so im quite pleased i managed this, someone with more experience would probably know a better way.

heres how i called it to my index.html page

Code:
<td class="FSB"><iframe SCROLLING="auto" SRC="http://www.YOURDOMAIN.net/news.php" FRAMEBORDER="0" width="173" height="100" valign="top"></iframe></td>
hope this is useful to anyone
   
Reply With Quote
  (#5) Old
edski Offline
New Member
 
Posts: 6
Join Date: Jun 2006
01-06-2006, 10:40 AM

any help on pull the dateline off the database and into the correct format would be very helpful
   
Reply With Quote
  (#6) Old
PolishPanda Offline
New Member
 
Posts: 6
Join Date: Jun 2006
07-06-2006, 11:06 PM

Does anyone have an answer to his question about the date? I'm wondering the same.

Actually, I'm wondering how I can duplicate the "Latest News" area in the login nav area (where you login and can search).

Thanks!
   
Reply With Quote
  (#7) Old
eiden Offline
Member
 
Posts: 237
Join Date: Apr 2006
Location: Norway
07-06-2006, 11:15 PM

Isn't it easier to just read and parse the RSS-XML feed ? (rss/index.php?_m=news&_a=view&group=default).

Don't know what scripting language you use on your server, but in ASP/VBscript this is easy, and it's no problem to edit the dateline into a normal date format.

Then you don't have to modify the source code.
   
Reply With Quote
  (#8) Old
Varun Shoor Offline
Chief Executive Officer
 
Varun Shoor's Avatar
 
Posts: 2,829
Join Date: May 2003
08-06-2006, 01:23 AM

Quote:
Originally Posted by eiden
Isn't it easier to just read and parse the RSS-XML feed ? (rss/index.php?_m=news&_a=view&group=default).

Don't know what scripting language you use on your server, but in ASP/VBscript this is easy, and it's no problem to edit the dateline into a normal date format.

Then you don't have to modify the source code.
Definately the way it should be done and the way we do it for our homepage.

Regards,

Varun Shoor


Varun Shoor (varun.shoor ]at[ kayako.com)
----------------------------------------------------------------
---
   
Reply With Quote
  (#9) Old
PolishPanda Offline
New Member
 
Posts: 6
Join Date: Jun 2006
08-06-2006, 01:38 AM

Could any of you give me some links to resources for that method? A link to a good RSS-XML parser would be helpful. Also, if possible, a script already made for that purpose.

Thanks,
Conrad
   
Reply With Quote
  (#10) Old
eiden Offline
Member
 
Posts: 237
Join Date: Apr 2006
Location: Norway
08-06-2006, 01:39 AM

Quote:
Originally Posted by PolishPanda
Could any of you give me some links to resources for that method? A link to a good RSS-XML parser would be helpful. Also, if possible, a script already made for that purpose.

Thanks,
Conrad

What language do you use ? PHP ?
   
Reply With Quote
  (#11) Old
PolishPanda Offline
New Member
 
Posts: 6
Join Date: Jun 2006
08-06-2006, 01:40 AM

Quote:
Originally Posted by eiden
What language do you use ? PHP ?
Yes sir.
   
Reply With Quote
  (#12) Old
Varun Shoor Offline
Chief Executive Officer
 
Varun Shoor's Avatar
 
Posts: 2,829
Join Date: May 2003
08-06-2006, 01:42 AM

Our code is tightly integrated into the site, There are couple of RSS parsers at http://www.hotscripts.com

Regards,

Varun Shoor


Varun Shoor (varun.shoor ]at[ kayako.com)
----------------------------------------------------------------
---
   
Reply With Quote
  (#13) Old
eiden Offline
Member
 
Posts: 237
Join Date: Apr 2006
Location: Norway
08-06-2006, 01:42 AM

I'm sure you will find plenty if you search on google for php rss or php rss parser
   
Reply With Quote
  (#14) Old
PolishPanda Offline
New Member
 
Posts: 6
Join Date: Jun 2006
08-06-2006, 01:50 AM

Awesome, thank you.

I got a script to parse the RSS but the date does not show up. I noticed that the date is enclosed in the <unixdate> tag. How do I go about adding the date and changng the layout the data is presented? Does this depend on the parser or do I have create some kind of script to get the desired effect?
   
Reply With Quote
  (#15) Old
eiden Offline
Member
 
Posts: 237
Join Date: Apr 2006
Location: Norway
08-06-2006, 01:52 AM

I'm not an expert on PHP, if you were using ASP I could be more helpful

What script did you download ? Could you post the link ?
   
Reply With Quote
Reply

Tags
home

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display news on non-esupport page. MarcelC SupportSuite, eSupport and LiveResponse 0 07-08-2006 01:26 AM



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46