Plugin Directory

Changeset 637452


Ignore:
Timestamp:
12/12/2012 04:56:32 AM (13 years ago)
Author:
vandai
Message:

Update versi 1.1.3

Location:
komper/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • komper/trunk/config.php

    r633328 r637452  
    1212define("KOMPER_TABLE_VALUE",$table_value);
    1313define("KOMPER_TABLE_PRODUCT",$table_product);
    14 define("KOMPER_VERSION","1.1.1");
    15 define("KOMPER_DB_VERSION","1.1");
     14define("KOMPER_VERSION","1.1.3");
     15define("KOMPER_DB_VERSION","1.2");
    1616define("DELIMITER",";");
    1717define("PAGE",$PAGE);
     
    3232          </script>";
    3333}
    34 function sanitizeValue(){
    35     if(isset($_POST))
    36             $_POST = sanitizeAll($_POST);
    37     if(isset($_GET))
    38             $_GET = sanitizeAll($_GET);
    3934
    40 }
    41 
    42 function sanitize($var){
    43     foreach ($var as $k => $value){
    44         $value = strip_tags($value);
    45         $var[] = htmlspecialchars($value,ENT_QUOTES);
    46     }
    47     return $var;
    48 }
    49 function sanitizeAll($var){
    50     if(is_array($var)){
    51             foreach ($var as $k => $value){
    52                     if(is_array($value)){
    53                             foreach ($value as $z => $valz){
    54                                     $valz = strip_tags($valz);
    55                                     //$value[$z] = ereg_replace("[^A-Za-z0-9@._-]", "",$value);
    56                                         $value[$z] = htmlspecialchars($valz,ENT_QUOTES);
    57                             }
    58                     }else{
    59                             $value = strip_tags($value);
    60                                 //$var[$k] = ereg_replace("[^A-Za-z0-9@._-]", "",$value);
    61                                 $var[$k] = htmlspecialchars($value,ENT_QUOTES);
    62                     }
    63 
    64             }
    65     }else{
    66             $var = strip_tags($var);
    67             //$var = ereg_replace("[^A-Za-z0-9@._-]", "",$var);
    68             $var = htmlspecialchars($var,ENT_QUOTES);
    69     }
    70             return $var;
    71 }
    7235?>
  • komper/trunk/komper.php

    r633388 r637452  
    44Plugin URI: http://www.vnetware.com/komper/
    55Description: A plugin to create side-by-side product comparison. This is free version, get the pro version with more features!
    6 Version: 1.1.2
     6Version: 1.1.3
    77Author: Miaz Akemapa
    88Author URI: http://www.photogrammer.net/
     
    1212
    1313function komper_admin() {
    14     $act = isset($_GET['act']) ? $_GET['act'] : "";
    15     if($act == 'test'){
    16         echo "tessstt";die();
    17     }
    18         include('komper_admin.php');
     14    include('komper_admin.php');
    1915}
    2016
     
    107103    $field_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM ".KOMPER_TABLE_NAME.";" ) );
    108104   
    109     if($fname != "" AND $ftype != "" AND $field_count < 10){
     105    if($fname != "" AND $ftype != "" AND $field_count < 15){
    110106        $wpdb->insert(KOMPER_TABLE_NAME,
    111107                array('field_name' => $fname,
     
    369365        $i=0;
    370366        foreach($fields as $row){
    371         $res.='<tr>
    372             <th>'.$row->field_name.'</th>';
     367            if($row->field_type == 'group'){$trclass='class="success fieldgroup"';$colspan = "colspan='".($p_jml+1)."'";}else {$trclass=""; $colspan="";}
     368        $res.='<tr '.$trclass.'>
     369            <td '.$colspan.'>'.$row->field_name.'</td>';
    373370           
    374371            for($x=0;$x<$p_jml;$x++){
    375                 $res.='<td>';
    376                 if($data[$x][$i]->field_type == "radio"){
    377                     if($data[$x][$i]->field_values == "yes"){
    378                         $res.='<i class="icon-ok"></i>';
     372                if($data[$x][$i]->field_type == "group"){
     373                    $res .= '';
     374                }else{
     375                    $res.='<td>';
     376                    if($data[$x][$i]->field_type == "radio"){
     377                        if($data[$x][$i]->field_values == "yes"){
     378                            $res.='<i class="icon-ok"></i>';
     379                        }else{
     380                            $res.='<i class="icon-remove"></i>';;
     381                        }
    379382                    }else{
    380                         $res.='<i class="icon-remove"></i>';;
    381                     }
    382                 }else{
    383                     $res.=format_text($data[$x][$i]->field_format,$data[$x][$i]->field_values);
    384                     //$res .= $data[$x][$i]->field_values;
     383                        $res.=format_text($data[$x][$i]->field_format,$data[$x][$i]->field_values);
     384                        //$res .= $data[$x][$i]->field_values;
     385                    }
     386                    $res.='</td>';
    385387                }
    386                 $res.='</td>';
    387388            }
    388389        $res.='</tr>';
     
    441442}
    442443
     444// Hook General Function
    443445add_action('init',list_fieldtype);
    444446add_action('init',list_textformat);
     
    447449
    448450function list_fieldtype(){
    449     $field_type= array('textarea' => 'Textarea','radio' => 'Radio Select','date' => 'Date');
     451    $field_type= array('textarea' => 'Textarea','radio' => 'Radio Select','date' => 'Date','group' => 'Field Group');
    450452    return $field_type;
    451453}
     
    482484}
    483485
     486
    484487?>
  • komper/trunk/komper_admin.php

    r633328 r637452  
    11<?php
    22require_once("config.php");
    3 sanitizeValue();
    43global $wpdb;
    54
     
    3433
    3534if($act == "insert"){
    36     include_once("insert_data.php");
     35    //include_once("insert_data.php");
     36    $pid = isset($_GET['pid']) ? $_GET['pid'] : "";
     37    $addsubmit = isset($_POST['addsubmit']) ? $_POST['addsubmit'] : "";
     38    $editsubmit = isset($_POST['editsubmit']) ? $_POST['editsubmit'] : "";
     39
     40    if($addsubmit != ""){
     41        $product_name = isset($_POST['product_name']) ? $_POST['product_name'] : "";
     42        $product_image = upload_img($_FILES);
     43        $wpdb->insert(KOMPER_TABLE_PRODUCT,
     44                array('product_name' => $product_name,
     45                    'product_image' => $product_image
     46                ), array('%s','%s')
     47        );
     48        $pid = $wpdb->insert_id;
     49        unset($_POST['product_name']);
     50        unset($_POST['addsubmit']);
     51        foreach($_POST as $key => $post){
     52            $wpdb->insert(KOMPER_TABLE_VALUE,
     53                array('product_id' => $pid,
     54                    'field_id' => $key,
     55                    'field_values' => $post
     56                ), array('%s','%s','%s','%s')
     57            ); 
     58        }
     59        //wp_safe_redirect( '?page='.PAGE.'&act=insert'); exit;
     60        echo '<META HTTP-EQUIV="Refresh" Content="0; URL=?page='.PAGE.'&act=insert">';
     61    }
     62
     63    if($editsubmit != ""){
     64
     65        $product_id = isset($_POST['pid']) ? $_POST['pid'] : "";
     66        $product_name = isset($_POST['product_name']) ? $_POST['product_name'] : "";
     67
     68        $fileName = isset($_FILES['product_img']['name']) ? $_FILES['product_img']['name'] : "" ;
     69        if($fileName != ""){
     70            $product_image = upload_img($_FILES);
     71            $wpdb->update(KOMPER_TABLE_PRODUCT,
     72                    array('product_name' => $product_name,
     73                        'product_image' => $product_image
     74                    ), array( 'id' => $product_id ),
     75                    array('%s','%s'), array('%d')
     76            );
     77        }else{
     78            $wpdb->update(KOMPER_TABLE_PRODUCT,
     79                    array('product_name' => $product_name
     80                    ), array( 'id' => $product_id ),
     81                    array('%s'), array('%d')
     82            );
     83        }
     84        unset($_POST['product_name']);
     85        unset($_POST['editsubmit']);
     86        unset($_POST['pid']);
     87        foreach($_POST as $key => $post){
     88            $ids = explode("|",$key);
     89            $pid = $ids[0];
     90            $fid = $ids[1];
     91
     92            if($pid != ""){
     93                $wpdb->update(KOMPER_TABLE_VALUE,
     94                    array('field_values' => $post
     95                    ), array('id' => $pid),
     96                    array('%s'), array('%d')
     97                ); 
     98            }else{
     99                $wpdb->insert(KOMPER_TABLE_VALUE,
     100                array('product_id' => $product_id,
     101                    'field_id' => $fid,
     102                    'field_values' => $post
     103                ), array('%s','%s','%s')
     104            ); 
     105            }
     106        }
     107        echo '<META HTTP-EQUIV="Refresh" Content="0; URL=?page='.PAGE.'&act=insert">';
     108    }
     109    function generateform($fieldType,$fieldName,$fieldId,$field_type,$val = null){
     110        $form = "";
     111        $val = isset($val) ? $val : "";
     112        if(array_key_exists($fieldType,$field_type)){
     113            switch($fieldType){
     114                case "group":
     115                    $form = "<hr noshade>";
     116                    break;
     117                case "textarea":
     118                    $form = "<textarea class='field span8' rows=3 name='".$fieldName."' id='".$fieldId."'>".$val."</textarea>";
     119                    break;
     120                case "radio";
     121                    if($val == "yes") $yes = "checked";else $yes = "";
     122                    if($val == "no" OR $val == "") $no = "checked";else $no = "";
     123                    $form = "<input type='radio' name='".$fieldName."' id='".$fieldId."_1' value='yes' $yes />Yes &nbsp;
     124                        <input type='radio' name='".$fieldName."' id='".$fieldId."_2' value='no' $no />No";
     125                    break;
     126                case "date":
     127                    echo '<script>
     128                        jQuery(function() {
     129                            jQuery("#date_'.$fieldId.'").datepicker({
     130                                changeMonth: true,
     131                                changeYear: true,
     132                                yearRange: "-50:+10",
     133                                dateFormat: "d MM yy"
     134                            });
     135                        });
     136                        </script>';
     137                    $form = "<input type='text' name='".$fieldName."' id='date_".$fieldId."' value='".$val."'>";
     138                break;
     139            }
     140        }
     141        return $form;
     142    }
     143
     144    function upload_img($files){
     145
     146        $uploaddir = str_replace('wp-admin/options-general.php','wp-content/products/',$_SERVER['SCRIPT_FILENAME']);
     147        $product_image = "";
     148        $fileName = isset($files['product_img']['name']) ? $files['product_img']['name'] : "" ;
     149        if($fileName != ""){
     150
     151            if(!is_dir($uploaddir)){
     152                mkdir($uploaddir,0755);
     153            }
     154            $fileSize = $_FILES['product_img']['size'];
     155            $fileError = $_FILES['product_img']['error'];
     156            if($fileSize > 0 || $fileError == 0){
     157                $ext = pathinfo($fileName, PATHINFO_EXTENSION);
     158                $newfilename = md5($fileName.time()).".".$ext;
     159                $move = move_uploaded_file($_FILES['product_img']['tmp_name'], $uploaddir.$newfilename);
     160                if($move){
     161                    $product_image = $newfilename;
     162
     163                    $thumbdir = $uploaddir."/thumb/";
     164                    if(!is_dir($thumbdir)){
     165                        mkdir($thumbdir,0755);
     166                    }
     167                    $thumb = $thumbdir.$newfilename;
     168                    resize($uploaddir.$newfilename,'180','180',$thumb);
     169                }
     170            }
     171        }
     172        return $product_image;
     173    }
     174
     175    //RESIZE IMAGE
     176    function resize($img, $w, $h, $newfilename) {
     177        if (!extension_loaded('gd') && !extension_loaded('gd2')) {
     178            trigger_error("GD is not loaded", E_USER_WARNING);
     179            return false;
     180        }
     181        $imgInfo = getimagesize($img);
     182            switch ($imgInfo[2]) {
     183            case 1: $im = imagecreatefromgif($img); break;
     184            case 2: $im = imagecreatefromjpeg($img);  break;
     185            case 3: $im = imagecreatefrompng($img); break;
     186            default:  trigger_error('Unsupported filetype!', E_USER_WARNING);  break;
     187        }
     188        if ($imgInfo[0] <= $w && $imgInfo[1] <= $h) {
     189            $nHeight = $imgInfo[1];
     190            $nWidth = $imgInfo[0];
     191        }else{
     192            if ($w/$imgInfo[0] > $h/$imgInfo[1]) {
     193                $nWidth = $w;
     194                $nHeight = $imgInfo[1]*($w/$imgInfo[0]);
     195                }else{
     196                $nWidth = $imgInfo[0]*($h/$imgInfo[1]);
     197                $nHeight = $h;
     198            }
     199        }
     200        $nWidth = round($nWidth);
     201        $nHeight = round($nHeight);
     202
     203        $newImg = imagecreatetruecolor($nWidth, $nHeight);
     204        if(($imgInfo[2] == 1) OR ($imgInfo[2]==3)){
     205            imagealphablending($newImg, false);
     206            imagesavealpha($newImg,true);
     207            $transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127);
     208            imagefilledrectangle($newImg, 0, 0, $nWidth, $nHeight, $transparent);
     209        }
     210        imagecopyresampled($newImg, $im, 0, 0, 0, 0, $nWidth, $nHeight, $imgInfo[0], $imgInfo[1]);
     211        switch ($imgInfo[2]) {
     212            case 1: imagegif($newImg,$newfilename); break;
     213            case 2: imagejpeg($newImg,$newfilename);  break;
     214            case 3: imagepng($newImg,$newfilename); break;
     215            default:  trigger_error('Failed resize image!', E_USER_WARNING);  break;
     216        }
     217
     218        return $newfilename;
     219    }
     220
     221    $fields = $wpdb->get_results("select * from ".KOMPER_TABLE_NAME." order by field_order asc");
     222
     223    wp_register_style( 'jqueryStyle', plugins_url('assets/css/smoothness/jquery-ui-1.9.0.custom.min.css', __FILE__) );
     224    wp_enqueue_style('jqueryStyle');
     225    ?>
     226    <script>
     227    jQuery(document).ready(function($) {
     228        $('#checkall').click(function() {
     229            $(this).closest('table').find(':checkbox').prop('checked', this.checked);
     230        });
     231
     232        //Delete Field Function
     233        $("#btndelfield").click(function(e) {
     234            var selected = new Array();
     235            $('input[type=checkbox]').each(function () {
     236                if($(this).is(':checked')){
     237                    selected.push($(this).attr('value'));
     238                }
     239            });
     240            if(selected != ""){
     241                if(confirm("Delete this fields?")){
     242                    var pids = selected;
     243                    var d_data = {
     244                            action: 'del_products',
     245                            pids: pids
     246                    };
     247                    $.post(ajaxurl, d_data, function(resp){
     248                        location.href='?page=<?php echo PAGE; ?>&act=insert';
     249                    });
     250                }
     251            }else{
     252                alert("Please select at least one field to delete.");
     253            }
     254            return false;
     255        });
     256    });
     257    </script>
     258        <div id="menu-management">
     259            <div class="nav-tabs-wrapper">
     260                <div class="nav-tabs">
     261                    <a href="?page=<?php echo PAGE; ?>" class="nav-tab hide-if-no-js">Field List</a>
     262                    <a href="?page=<?php echo PAGE; ?>&act=insert" class="nav-tab nav-tab-active">Product List</a>
     263                </div>
     264            </div>
     265            <div class="menu-edit">
     266                <div id="nav-menu-header">
     267                        <div id="submitpost" class="submitbox">
     268                            <div class="major-publishing-actions">
     269                                <div class="publishing-action">
     270                                    <h3><span>Product List</span></h3>
     271                                </div>
     272                            </div>
     273                        </div>
     274                    </div>
     275                    <div id="post-body">
     276                        <div id="post-body-content">
     277                            <?php if($do == "new"){  ?>
     278                            <div id="menu-instructions" class="post-body-plain" style="padding:10px;">
     279                                <form name="newproduct" class="form-horizontal" onsubmit="return true;" action="?page=<?php echo PAGE;?>&act=insert" method="POST" accept-charset="utf-8" enctype="multipart/form-data">
     280                                  <div class="control-group">
     281                                    <label class="control-label" for="product_name">Product Name</label>
     282                                    <div class="controls">
     283                                      <input type="text" id="product_name" name="product_name">
     284                                    </div>
     285                                  </div>
     286                                  <div class="control-group">
     287                                    <label class="control-label" for="product_image">Product Image</label>
     288                                    <div class="controls">
     289                                      <input type="file" name="product_img" id="product_img">
     290                                    </div>
     291                                  </div>
     292                                  <?php foreach($fields as $row){ ?>
     293                                  <div class="control-group">
     294                                    <label class="control-label" for="<?php echo $row->id;?>"><?php echo $row->field_name;?></label>
     295                                    <div class="controls">
     296                                      <?php echo generateform($row->field_type,$row->id,$row->id,$field_type); ?>
     297                                    </div>
     298                                  </div>
     299                                  <?php } ?>
     300                                  <div class="control-group">
     301                                    <div class="controls">
     302                                      <input type="submit" name="addsubmit" id="addsubmit" class="button button-primary" value="Submit" />
     303                                      <input type="button" name="btncancel" id="btncancel" class="button button-primary" value="Cancel" onclick="window.location.href = '?page=<?php echo PAGE; ?>&act=insert';" />
     304                                    </div>
     305                                  </div>
     306                                </form>
     307                            </div>
     308                            <?php } elseif($do == "edit") {
     309                            $fields = $wpdb->get_results("SELECT a.*,b.field_values, b.id as pid FROM ".KOMPER_TABLE_NAME." a left join ".KOMPER_TABLE_VALUE." b on a.id = b.field_id and b.product_id = '".$pid."' order by a.field_order asc");
     310                            $prod = $wpdb->get_row("select * from ".KOMPER_TABLE_PRODUCT." where id = '".$pid."' ");
     311                            ?>
     312                            <div id="menu-instructions" class="post-body-plain" style="padding:10px;">
     313                                <form name="newproduct" class="form-horizontal" onsubmit="return ture;" action="?page=<?php echo PAGE;?>&act=insert&do=edit&pid=<?php echo $pid;?>" method="POST" accept-charset="utf-8" enctype="multipart/form-data">
     314                                  <input type="hidden" id="pid" name="pid" value="<?php echo $prod->id; ?>" />
     315                                    <div class="control-group">
     316                                    <label class="control-label" for="product_name">Product Name</label>
     317                                    <div class="controls">
     318                                      <input type="text" id="product_name" name="product_name" value="<?php echo $prod->product_name; ?>" />
     319                                    </div>
     320                                  </div>
     321                                  <div class="control-group">
     322                                    <label class="control-label" for="product_img">Product Image</label>
     323                                    <div class="controls">
     324                                      <input type="file" name="product_img" id="product_img">
     325                                    </div>
     326                                  </div>
     327                                  <?php foreach($fields as $row){ ?>
     328                                  <div class="control-group">
     329                                    <label class="control-label" for="<?php echo $row->pid;?>"><?php echo $row->field_name;?></label>
     330                                    <div class="controls">
     331                                      <?php echo generateform($row->field_type,$row->pid."|".$row->id,$row->id,$field_type, $row->field_values); ?>
     332                                    </div>
     333                                  </div>
     334                                  <?php } ?>
     335                                  <div class="control-group">
     336                                    <div class="controls">
     337                                      <input type="submit" name="editsubmit" id="editsubmit" class="button button-primary" value="Submit" />
     338                                      <input type="button" name="btncancel" id="btncancel" class="button button-primary" value="Cancel" onclick="window.location.href = '?page=<?php echo PAGE; ?>&act=insert';" />
     339                                    </div>
     340                                  </div>
     341                                </form>
     342                            </div>
     343                            <?php } else {
     344                                $perpage = 20;
     345                                $page = isset($_GET['p']) ? $_GET['p'] : "1";
     346
     347                                $sql = "select * from ".KOMPER_TABLE_PRODUCT." order by id desc";
     348                                $tot_products = count($wpdb->get_results($sql));   
     349                                $pages = ceil($tot_products/$perpage);
     350
     351                                $offset = ($page - 1) * $perpage;
     352
     353                                $sql2 = $sql." limit $offset,$perpage";
     354                                $products = $wpdb->get_results($sql2);
     355
     356                            ?>
     357                            <div id="menu-instructions" class="post-body-plain" style="padding:10px;width:550px;">
     358                                <div class="row-fluid">
     359                                    <div class="span6">
     360                                        <a class="btn btn-warning" name="btndelfield" id="btndelfield">Delete Selected</a>
     361                                    </div>
     362                                    <div class="span6" align="right">
     363                                        <a href="?page=<?php echo PAGE; ?>&act=insert&do=new" class="btn btn-primary">Add New Product</a>
     364                                    </div>
     365                                </div>
     366
     367                                <div>
     368                                <table class="table table-striped table-bordered">
     369                                  <thead>
     370                                    <tr>
     371                                        <th><input type="checkbox" class="checkbox checkall" id="checkall" name="checkall" /></th>
     372                                        <th>No</th>
     373                                        <th>Product Name</th>
     374                                        <th>Action</th>
     375                                    </tr>
     376                                  </thead>
     377                                  <tbody>
     378                                    <?php $i=0;
     379                                    if(count($products) > 0){
     380                                    foreach($products as $row) { $i++; ?>
     381                                    <tr>
     382                                        <td><input type="checkbox" class="checkbox" name="delcheck" id="delcheck" value="<?php echo $row->id; ?>" /></td>
     383                                        <td width="5%"><?php echo $i; ?></td>
     384                                        <td width="70%">
     385                                            <a href='<?php echo get_site_url()."/komper.php?kpids=".$row->id."&target=noheader"; ?>' data-toggle="modal" data-target="#sampleOutput">
     386                                                <?php echo $row->product_name;?>
     387                                            </a>
     388                                        </td>
     389                                        <td width="20%">
     390                                            <a href="?page=<?php echo PAGE; ?>&act=insert&do=edit&pid=<?php echo $row->id; ?>" class="btn btn-link" id="editbtn"><i class="icon-edit"></i> Edit</a>
     391                                        </td>
     392                                    </tr>
     393                                    <?php }
     394                                    } else{ ?>
     395                                       <tr>
     396                                           <td colspan="4">No Products</td>
     397                                       </tr>
     398                                    <? }?>
     399                                  </tbody>
     400                                </table>
     401                                </div>
     402                                <div class="pagination pagination-centered">
     403                                    <ul>
     404                                        <?php
     405                                        if($page == 1) { $state = "class=\"disabled\""; $prev = "#";}else {$state = ""; $prev = "?page=".PAGE."&act=insert&p=".($page - 1);}
     406                                        echo "<li ".$state."><a href='".$prev."'>Prev</a></li>";
     407                                        for($i=1; $i<=$pages; $i++){
     408                                            if($page == $i) $state = "class=\"active\""; else $state = "";
     409                                            echo '<li '.$state.'><a href="?page='.PAGE.'&act=insert&p='.$i.'">'.$i.'</a></li>';
     410                                        }
     411                                        if($page == ($i-1)) { $state = "class=\"disabled\""; $next = "#";}else {$state = ""; $next = "?page=".PAGE."&act=insert&p=".($page + 1);}
     412                                        echo "<li ".$state."><a href='".$next."'>Next</a></li>";
     413                                        ?>
     414                                    </ul>
     415                                </div>
     416                                <div align="right">
     417                                    <span class="label"><?php echo $tot_products;?> Products</span>
     418                                </div>
     419                            </div>
     420
     421                            <?php } ?>
     422                        </div><!-- /#post-body-content -->
     423
     424                    </div><!-- /#post-body -->
     425                    <div id="nav-menu-footer">
     426                        <div class="major-publishing-actions">
     427                        <div class="publishing-action">
     428                            &nbsp;
     429                        </div>
     430                        </div>
     431                    </div><!-- /#nav-menu-footer -->
     432            </div><!-- /.menu-edit -->
     433            <div class="alert alert-info">
     434                <h4>You are using Komper free version</h4>
     435                With free version you can create up to 15 fields, and compare 2 products. <br />
     436                Upgrade to Pro version to get unlimited fields, unlimited products to compare, insert comparation table to your posts or pages, and more.. <br />
     437                Get it here: <a href="http://www.vnetware.com/" target="_blank">http://www.vnetware.com/</a>
     438            </div>
     439            <!-- MODAL SAMPLE OUTPUT -->
     440    <div class="modal hide" id="sampleOutput" tabindex="-1" role="dialog" aria-labelledby="outputLabel" aria-hidden="true">
     441      <div class="modal-header">
     442        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
     443        <h3 id="outputLabel">Sample Output</h3>
     444      </div>
     445      <div class="modal-body">
     446        <p>loading..</p>
     447      </div>
     448      <div class="modal-footer">
     449        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
     450      </div>
     451    </div>
     452        <!-- END MODAL SAMPLE OUTPUT -->   
     453    </div>
     454<?
    37455}elseif($act == "output"){
    38456    include_once("output.php");
     
    45463       
    46464    jQuery(document).ready(function($) {
    47         if(totfield >= 10){
     465        if(totfield >= 15){
    48466            $("#divaddfield").hide();
    49467        }
     
    157575        });
    158576        function check_totfields(icount){
    159             if(icount >= 10){
     577            if(icount >= 15){
    160578                $("#infomsgerror").text('You have reached maximum amount of fields!');
    161579                $("#divmsgerror").show();
     
    255673                                    <tbody>
    256674                                    <?php $i = 0; foreach($datafields as $row){ $i++; ?>
    257                                         <tr id="kompfield_<?php echo $row->id; ?>">
     675                                        <tr id="kompfield_<?php echo $row->id; ?>" <?php if($row->field_type == 'group') echo ' class=\'success\'';?>>
    258676                                            <td><input type="checkbox" class="checkbox" value="<?php echo $row->id; ?>" id="check_<?php echo $i;?>" name="check[]" /></td>
    259677                                            <td><?php echo $row->field_name;?></td>
     
    281699        <div class="alert alert-info">
    282700          <h4>You are using Komper free version</h4>
    283             With free version you can create up to 10 fields, and compare 2 products. <br />
     701            With free version you can create up to 15 fields, and compare 2 products. <br />
    284702            Upgrade to Pro version to get unlimited fields, unlimited products to compare, insert comparation table to your posts or pages, and more.. <br />
    285703          Get it here: <a href="http://www.vnetware.com/" target="_blank">http://www.vnetware.com/</a>
  • komper/trunk/output.php

    r633388 r637452  
    5959        $i=0;
    6060        foreach($fields as $row){
    61         $res.='<tr>
    62             <th>'.$row->field_name.'</th>';
     61            if($row->field_type == 'group'){$trclass='class="success fieldgroup"';$colspan = "colspan='".($p_jml+1)."'";}else {$trclass=""; $colspan="";}
     62        $res.='<tr '.$trclass.'>
     63            <td '.$colspan.'>'.$row->field_name.'</td>';
    6364           
    6465            for($x=0;$x<$p_jml;$x++){
    65                 $res.='<td>';
    66                 if($data[$x][$i]->field_type == "radio"){
    67                     if($data[$x][$i]->field_values == "yes"){
    68                         $res.='<i class="icon-ok"></i>';
     66                if($data[$x][$i]->field_type == "group"){
     67                    $res .= '';
     68                }else{
     69                    $res.='<td>';
     70                    if($data[$x][$i]->field_type == "radio"){
     71                        if($data[$x][$i]->field_values == "yes"){
     72                            $res.='<i class="icon-ok"></i>';
     73                        }else{
     74                            $res.='<i class="icon-remove"></i>';;
     75                        }
    6976                    }else{
    70                         $res.='<i class="icon-remove"></i>';;
    71                     }
    72                 }else{
    73                     $res.=format_text($data[$x][$i]->field_format,$data[$x][$i]->field_values);
     77                        $res.=format_text($data[$x][$i]->field_format,$data[$x][$i]->field_values);
     78                    }
     79                    $res.='</td>';
    7480                }
    75                 $res.='</td>';
    7681            }
    7782        $res.='</tr>';
  • komper/trunk/readme.txt

    r633388 r637452  
    44Tags: compare,comparison,product,price,chart,table
    55Requires at least: 3.0.1
    6 Tested up to: 3.4
     6Tested up to: 3.5
    77Stable tag: 1.1.2
    88License: GPLv2 or later
     
    2727
    2828**Coming Soon**
     29
    2930*   More Field type
    3031*   New table layout
    3132*   Customizeable css table
    3233
     34
    3335Please note this is the free version.
    34 In this free version, you can create up to 10 fields and display 2 products to compare.
     36In this free version, you can create up to 15 fields and display 2 products to compare.
    3537
    3638__Upgrade to Pro version__, and get more features:
     
    3840*   Unlimited product specification fields
    3941*   Unlimited product to compare
    40 *   Insert product comparison table and comparison form in any posts or pages.
     42*   Shortcode supported, Insert product comparison table and comparison form in any posts or pages.
    4143*   Full Support
    4244
     
    4446[http://www.vnetware.com/](http://www.vnetware.com/)
    4547
     48Try Demo:
     49[http://demo.vnetware.com/komper](http://demo.vnetware.com/komper/)
    4650
    4751== Installation ==
    4852
    49 1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
     531. Upload `komper.zip` to the `/wp-content/plugins/` directory
    50542. Activate the plugin through the 'Plugins' menu in WordPress
    51553. Go to *(Settings - Komper Settings)*
    52564. Activate Komper Widget in *(Appearance - Widgets)*
     575. Update your Permalink. Go to *(Settings - Permalink)* and click *"Save Changes"*. This is required for Output page as we use rewrite rules to display Comparison results. You don't have to change the permalink, just click "save".
    5358
    5459== Frequently Asked Questions ==
     
    8893= Comparison page can not display, 404 Error! =
    8994
    90 Try to change the wordpresspermalink to *Post Name*
     95Try to change the wordpress permalink to *"Post Name"*
    9196
    9297
     
    103108
    104109== Changelog ==
     110
     111= 1.1.3 =
     112* Support new Wordpress 3.5
     113* FIX: Fatal Error for function: SanitizeValue()
     114* FIX minor bugs
     115* NEW: Field Group
     116* UPDATE: Field limit now up-to 15!
     117* UPDATE: Image thumbnail now reduce to 180x180 pixels
    105118
    106119= 1.1.2 =
Note: See TracChangeset for help on using the changeset viewer.