Jump to content

CryptoN

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

CryptoN's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I want to build a guide like the max-ot guide you can find at http://ast-ss.com/maxot.php You can login and the guide structure with this email and password: ocnewton@gmail.com test123 My problem is that I dont know how to build a guide like this. How should I design my tables in the database? How many tables should it be? How can I accomplish this? /Bryan
  2. Hi, I have a database with a table containing different dates. These dates have different "status". The status can either be 1 or 2. If the status is 2, the appropriate date should be marked with red background. Exampel, if the date 2010-09-28 has the status 2 in the table, then 28 should be marked with red background in the table. Here are som code: <?php include("../db.php"); $query = "SELECT published FROM calendar WHERE status=2"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $published = $row['published']; } ?> <script> $(document).ready(function() { $("#datepicker").datepicker({ beforeShowDay: function(date) { var array_data = date; var mysql_data= ["<?php echo $published; ?>"]; if(jQuery.inArray(date,mysql_data) > -1) { // Here should the date be redmarked. } else { return new Array(true, 'not_taken', 'Den här dagen är öppen: ' + date.toString("yyyy-MM-dd")); } } }); });
  3. Hi everyone! The code above takes the news from a table and insert the news into Joomlas jos_content <?php $user = "****"; $pass = "****"; $host = "localhost"; $database = "nh"; $connection = mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $query = "SELECT * FROM admin_news ORDER BY nid DESC LIMIT 10"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $row['headline']; $row['nick']; $row['date']; $row['preview']; $row['news']; $database2 = "joomla"; mysql_select_db($database2,$connection) or die(mysql_error()); $query2 = "INSERT INTO jos_content( title, alias, title_alias, introtext, `fulltext`, state, sectionid, mask, catid, Created, Created_by, Created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc, access, hits, metadata) VALUES( '".mysql_real_escape_string($row['headline'])."', '', '', '".mysql_real_escape_string($row['preview'])."', '".mysql_real_escape_string($row['news'])."', '', 2, '', 1, '', 62, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')"; $result2 = mysql_query($query2) or die(mysql_error()); } echo "done"; ?> The problem is when I set the sectionid to 2, which is the id for the News Section. But in the administrator, the news doesn't belong to any section, and it is defined as "Uncategorised". How can I solve this?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.