Exemple #1
0
 function set_category_kw($cat_id, &$keyword_q, &$location_q)
 {
     $keyword_q = '';
     $location_q = '';
     $cat_id = (int) $cat_id;
     $sql = "SELECT * FROM IndeedXML_keywords WHERE category_id='" . jb_escape_sql($cat_id) . "' ";
     $result = jb_mysql_query($sql);
     $row = JB_mysql_fetch_array($result);
     if (strlen($row['kw']) > 0) {
         // keywords
         $keyword_q = trim($row['kw']);
     } else {
         $keyword_q = JB_getCatName($cat_id);
         // use the category name itself as the keyword
     }
     if (strlen($row['loc']) > 0) {
         // location
         $location_q = trim($row['loc']);
     } else {
         $location_q = $this->config['l'];
         // use the default location from the config
     }
 }
Exemple #2
0
function showSubcat($c)
{
    //global $connection;
    global $SimplyHiredXML_default_l;
    global $SimplyHiredXML_default_k;
    $query = " SELECT *, categories.category_id as CID, seo_keys FROM categories LEFT JOIN SimplyHiredXML_keywords ON categories.category_id = SimplyHiredXML_keywords.category_id  WHERE parent_category_id = '" . jb_escape_sql($c) . "' and form_id=1 ORDER BY list_order, category_name ASC ";
    $result = jb_mysql_query($query);
    //echo "<b>cateid:".$row2[1]."  $query </b>";
    if (JB_mysql_num_rows($result) == 0) {
        $query = " SELECT kw, loc, categories.category_id as CID, seo_keys FROM categories LEFT JOIN SimplyHiredXML_keywords ON categories.category_id = SimplyHiredXML_keywords.category_id  WHERE categories.category_id = '" . jb_escape_sql($c) . "' and form_id=1 ";
        $result = jb_mysql_query($query);
        $row = JB_mysql_fetch_array($result);
        if (trim($row['loc']) == '') {
            $row['loc'] = $SimplyHiredXML_default_l;
        }
        if (trim($row['kw']) == '') {
            $row['kw'] = $row['seo_keys'];
        }
        if (trim($row['kw']) == '') {
            // still empty?
            $row['kw'] = JB_getCatName($row['CID']);
            //$SimplyHiredXML_default_k;
        }
        ?>
	What: <input size='36' type="text" value="<?php 
        echo jb_escape_html($row['kw']);
        ?>
" name='kw_<?php 
        echo $row['CID'];
        ?>
'>
	Where: <input size='36' type="text" value="<?php 
        echo jb_escape_html($row['loc']);
        ?>
" name='loc_<?php 
        echo $row['CID'];
        ?>
'><br>
	<?php 
    } else {
        $x = 0;
        echo "<br><div style='margin-left: 20px;'>";
        while ($row = JB_mysql_fetch_array($result)) {
            $x++;
            if ($x > SHOW_SUBCATS) {
                break;
            }
            //if  ($row['allow_records']=='N') echo "<b>&#8224;</b>";
            echo "<A HREF=" . $_SERVER['PHP_SELF'] . "?cat=" . $row['CID'] . "><font color=#0000FF>" . jb_escape_html($row['category_name']) . "</font></A> ";
            //;echo "<small>(ID: ". ($row[0]).")</small>";
            if (trim($row['loc']) == '') {
                $row['loc'] = $SimplyHiredXML_default_l;
            }
            if (trim($row['kw']) == '') {
                $row['kw'] = $row['seo_keys'];
            }
            if (trim($row['kw']) == '') {
                // still empty?
                //$row['kw'] = $SimplyHiredXML_default_k;
                $row['kw'] = JB_getCatName($row['CID']);
            }
            ?>
		What: <input size='35' type="text" value="<?php 
            echo jb_escape_html($row['kw']);
            ?>
" name='kw_<?php 
            echo $row['CID'];
            ?>
'>
		Where: <input size='35' type="text" value="<?php 
            echo jb_escape_html($row['loc']);
            ?>
" name='loc_<?php 
            echo $row['CID'];
            ?>
'>
		<br>

		<?php 
            // does this category have sub-categories?
            $query = " SELECT * FROM categories LEFT JOIN SimplyHiredXML_keywords ON categories.category_id = SimplyHiredXML_keywords.category_id  WHERE parent_category_id = '" . $row['CID'] . "' ORDER BY list_order, category_name ASC ";
            $result2 = jb_mysql_query($query);
            if (JB_mysql_num_rows($result2) > 0) {
                echo "<br>";
                $row2 = JB_mysql_fetch_row($result2);
                ?>
		  <table style="margin-left: 15px;" cellspacing="1" border="0" width="100%">

		<?php 
                showAllCat($row['CID'], 1);
                ?>

		</table>
		<?php 
            }
        }
    }
    echo "</div>";
}