Ejemplo n.º 1
0
function assign_ad_template($prams)
{
    global $label;
    $str = $label['mouseover_ad_template'];
    $sql = "SELECT * FROM form_fields WHERE form_id='1' AND field_type != 'SEPERATOR' AND field_type != 'BLANK' AND field_type != 'NOTE' ";
    //echo $sql;
    $result = mysql_query($sql) or die(mysql_error());
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        if ($row['field_type'] == 'IMAGE') {
            if (file_exists(UPLOAD_PATH . 'images/' . $prams[$row['field_id']]) && $prams[$row['field_id']]) {
                $str = str_replace('%' . $row['template_tag'] . '%', '<img alt="" src="' . UPLOAD_HTTP_PATH . "images/" . $prams[$row['field_id']] . '" >', $str);
            } else {
                //$str = str_replace('%'.$row['template_tag'].'%',  '<IMG SRC="'.UPLOAD_HTTP_PATH.'images/no-image.gif" WIDTH="150" HEIGHT="150" BORDER="0" ALT="">', $str);
                $str = str_replace('%' . $row['template_tag'] . '%', '', $str);
            }
        } else {
            $str = str_replace('%' . $row['template_tag'] . '%', get_template_value($row['template_tag'], 1), $str);
        }
        $str = str_replace('$' . $row['template_tag'] . '$', get_template_field_label($row['template_tag'], 1), $str);
    }
    return $str;
}
Ejemplo n.º 2
0
function echo_list_head_data_admin($form_id)
{
    global $q_string, $column_list;
    $sql = "SELECT * FROM form_lists where form_id='{$form_id}' ORDER BY sort_order ASC ";
    $result = mysql_query($sql);
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $column_list[$row['field_id']] = $row['template_tag'];
        //echo $row['template_tag'];
        ?>
		<td class="list_header_cell" nowrap>
		<?php 
        echo '<small>(' . $row['sort_order'] . ')</small>';
        ?>
		<a href='<?php 
        echo htmlentities($_SERVER['PHP_SELF']);
        ?>
?action=edit&column_id=<?php 
        echo $row['column_id'];
        ?>
'><?php 
        echo get_template_field_label($row['template_tag'], $form_id);
        ?>
</a> <a onClick="return confirmLink(this, 'Delete this column from view, are you sure?') " href="<?php 
        echo htmlentities($_SERVER['PHP_SELF']);
        ?>
?action=del&column_id=<?php 
        echo $row['column_id'];
        ?>
"><IMG src='delete.gif' width='16' height='16' border='0' alt='Delete'></a> 
<a href="<?php 
        echo htmlentities($_SERVER['PHP_SELF']);
        ?>
?action=edit&column_id=<?php 
        echo $row['column_id'];
        ?>
">
   <IMG alt="edit" src="edit.gif" width="16" height="16" border="0" alt="Edit">
		</td>
		<?php 
    }
    ?>
		<?php 
}