if (!$user || mysql_num_rows($user) <= 0) {
    create_error($access_token, 'PHP', 'get_artists.php', 'No user found', $db);
    die('No user found');
}
$user_row = mysql_fetch_array($user, MYSQL_ASSOC);
$galleryId = $user_row['gallery_id'];
$galleryFolder = 'gallery_' . $galleryId . '/';
$galleryDirectory = $destination_folder . $galleryFolder;
$result_artists = mysql_query("select * from artist where gallery_id = '" . $galleryId . "'", $db);
$json_response_artists = array();
while ($row = mysql_fetch_array($result_artists, MYSQL_ASSOC)) {
    $row_array['id'] = $row['id'];
    $row_array['slug'] = $row['id'];
    $row_array['name'] = utf8_encode($row['name']);
    $row_array['imgName'] = utf8_encode($row['img']);
    $row_array['imgPath'] = getImgPath($galleryFolder, $galleryDirectory, utf8_encode($row['img']));
    $row_array['imgOverviewPath'] = getImgOverviewPath($galleryDirectory, utf8_encode($row['img']));
    $row_array['location'] = utf8_encode($row['location']);
    $row_array['description'] = utf8_encode($row['description']);
    if ($row['display'] == 1 || $row['display'] == '1') {
        $row_array['display'] = true;
    } else {
        $row_array['display'] = false;
    }
    $result_artworks = mysql_query("select * from artwork where artist_id= '" . $row_array['id'] . "'", $db);
    $row_array['artworks'] = array();
    while ($row_artwork = mysql_fetch_array($result_artworks, MYSQL_ASSOC)) {
        array_push($row_array['artworks'], intval($row_artwork['id']));
    }
    $row_array['artworksQty'] = sizeof($row_array['artworks']);
    array_push($json_response_artists, $row_array);
Exemple #2
0
    function checkPost($post, $user)
    {
        $user = urldecode($user);
        $this->curProfile = $user;
        $this->postID = $post;
        /**
         *POST ALL POST 
         **/
        $this->dbHandle->setRquery("SELECT * FROM amistiUser WHERE uName=?", array($this->curProfile));
        $res = $this->dbHandle->getRquery();
        $this->postUser = $res[0]['fName'] . " " . $res[0]['sName'];
        // get the post details
        $this->postUserName = $res[0]['uName'];
        $this->profileID = $res[0]['userID'];
        //GET OR SET PROFILE IMAGE
        $this->dbHandle->setRquery("SELECT * FROM amistiProfilePic WHERE userID=? AND profilePicCurrent=?", array($this->profileID, 1));
        $profilePicRes = $this->dbHandle->getRquery();
        $this->postUserIcon = getImgPath($profilePicRes[0]['profileImgPath']);
        $this->dbHandle->setRquery("SELECT * FROM amistiPost  INNER JOIN amistiUser ON amistiPost.userID = amistiUser.userID\n\t                    WHERE amistiPost.postID=? ", array($this->postID));
        // GET POST
        $results = $this->dbHandle->getRquery();
        if (count($results) > 0) {
            //get post results and iterate
            for ($x = 0; $x < count($results); $x++) {
                // get user data from table user
                //POPULATE THE VARIABLES
                $this->postID = $results[$x]['postID'];
                $this->postText = $results[$x]['postText'];
                $this->postTime = $results[$x]['postTime'];
                $this->postUserID = $results[$x]['userID'];
                if ($results[$x]['postShow'] == 1) {
                    //----check if the postShow is equal 1 ie show to public
                    //get user icon
                    $uIcon = empty($this->postUserIcon) || $this->postUserIcon == "" ? "./libs/libImages/icons/Man.png" : $this->postUserIcon;
                    ?>
    
    <!-- Center Content Class -->
    
    <div class="CC" id="POST_<?php 
                    echo $this->postID;
                    ?>
" > 
      
      <!-- Edit or menu point -->
      <div class="ccPoint">...</div>
     
      <!-- Poster icon/photo -->
      <div class="ccIcon"><a href="/?user=<?php 
                    echo $this->postUserName;
                    ?>
&post=<?php 
                    echo $this->postID;
                    ?>
"> <img src="<?php 
                    echo $uIcon;
                    ?>
" alt="<?php 
                    echo $this->postUser;
                    ?>
"> </a> </div>
      
      <!-- Poster data , place and time -->
      <div class=" ccUData">
        <h2>		<a href="/?user=<?php 
                    echo $this->postUserName;
                    ?>
"> 
	  <?php 
                    echo $this->postUser;
                    ?>
 
      </a>
       </h2>
       
        <ul>
          <li> <?php 
                    echo relativeTime($this->postTime);
                    ?>
 </li>
          <li>&middot;</li>
          <li class="locationIcon"> location not set</li> <!--- POST LOCATION SETTING HERE --------- -->
        </ul>
      </div>
      
  
  <div class="ccPointMenus"><!-- POP UP MENU --->
       
      <?php 
                    if ($this->curProfile == $_SESSION['uName']) {
                        //IF THE CURRENT PROFILE VIEWER IS THE SAME AS THE OWNER
                        ?>
  
       <li>
       <div class="postHidePost" ><strong>Show/Hide</strong><br>show or hide post from public</div>
       </li>
       
       <li>
       <div class="postEditPost"><strong>Edit</strong><br>edit this post</div>
       </li>
       
       <li>
        <div class="postLocationPost"><strong>Set Location</strong><br>add location to post</div>
        </li>
       
        <li>
         <div class="postDeletePost"><strong>Delete</strong><br>delete this post</div>
         </li>
         
        <?php 
                    } else {
                        ?>
        
		  <li>
          <div class="postReportPost"><strong>Report</strong><br>report this post</div>
          </li>
          
		 <?php 
                    }
                    ?>
     
       </div>
       
  
  <!-- inner for multumedis --->
  <?php 
                    //CHECK IF POST HAD IMAGES IN THE AMISTI PIC TABLE
                    $this->dbHandle->setRquery("SELECT * FROM amistiPic WHERE postID=? and userID=?  ORDER BY picTime DESC", array($this->postID, $res[0]['userID']));
                    $picImageRes = $this->dbHandle->getRQuery();
                    $countPics = count($picImageRes);
                    if (count($picImageRes) > 0) {
                        // check if post contain media in the database
                        if ($countPics == 1) {
                            ?>
      <div class="ccInnerM">
      

		 <?php 
                            list($xx, $yy) = getimagesize($picImageRes[0]['picBigImgPath']);
                            // get Image size for One img view
                            ?>
  
        
             <a href="/photos?user=<?php 
                            echo $this->postUserName;
                            ?>
&PN=1&imgID=<?php 
                            echo $picImageRes[0]['picID'];
                            ?>
&PVB=true&album=postImages" class="photoViewBig">
               
      <div class="ccInnerM1" 
      style="background-image:url('<?php 
                            echo getImgPath($picImageRes[0]['picBigImgPath']);
                            ?>
');
      background-size:<?php 
                            echo $xx > "600" ? "600px" : "auto";
                            ?>
 <?php 
                            echo $yy > "400" ? "400px" : "auto";
                            ?>
;">
     </div> 
      </a>
      </div>
      <?php 
                        } elseif ($countPics == 2) {
                            //show 2 pics
                            $picDS2;
                            for ($picC2 = 0; $picC2 < $countPics; $picC2++) {
                                $picName2 = $this->postUserName;
                                $picImageID = $picImageRes[$picC2]['picID'];
                                $picImagePath = getImgPath($picImageRes[$picC2]['picBigImgPath']);
                                $picDS2 .= "\n   \n      <a href=/photos?user={$picName2}&PN=1&imgID={$picImageID}&PVB=true&album=postImages class=photoViewBig>\n      <span class=ccInnerM2 style=background-image:url({$picImagePath})> </span>\n      </a>";
                            }
                            ?>
 <div class="ccInnerM"> <?php 
                            echo $picDS2;
                            ?>
</div><?php 
                            // echo 2 image out
                        } elseif ($countPics == 3) {
                            // show 3 pics
                            $pic2 = 0;
                            $picDS;
                            for ($picC2 = 0; $picC2 < $countPics; $picC2++) {
                                $picName2 = $this->postUserName;
                                $picImageID = $picImageRes[$picC2]['picID'];
                                $picImagePath = getImgPath($picImageRes[$picC2]['picBigImgPath']);
                                if ($picC2 == 0) {
                                    $picDS3 .= "\n   \n      <a href=/photos?user={$picName2}&PN=1&imgID={$picImageID}&PVB=true&album=postImages class=photoViewBig>\n      <span class=ccInnerM2 style=background-image:url({$picImagePath})> </span>\n      </a>";
                                } else {
                                    $picDS3 .= "\n   \n      <a href=/photos?user={$picName2}&PN=1&imgID={$picImageID}&PVB=true&album=postImages class=photoViewBig>\n      <span class=ccInnerM3 style=background-image:url({$picImagePath})> </span>\n      </a>";
                                }
                            }
                            ?>
 <div class="ccInnerM"> <?php 
                            echo $picDS3;
                            ?>
</div><?php 
                            // echo 3 immage out
                        } elseif ($countPics == 4) {
                            //CHECK FOR $ IMAGES
                            $picDS4;
                            for ($xPic = 0; $xPic < $countPics; $xPic++) {
                                // Show 4 Pics
                                $picName2 = $this->postUserName;
                                $picImageID = $picImageRes[$xPic]['picID'];
                                $picImagePath = getImgPath($picImageRes[$xPic]['picBigImgPath']);
                                $picDS4 .= "\n   \n      <a href=/photos?user={$picName2}&PN=1&imgID={$picImageID}&PVB=true&album=postImages class=photoViewBig>\n      <span class=ccInnerM3 style=background-image:url({$picImagePath})> </span>\n      </a>";
                            }
                            ?>
 <div class="ccInnerM"> <?php 
                            echo $picDS4;
                            ?>
</div><?php 
                            //ECHO 4 IMAGES
                        }
                    } else {
                        ?>
 <div class="ccInnerM"></div><?php 
                        //empty ccInnerM box to keep the shape
                    }
                    if (!empty($this->postText)) {
                        // check for post texts by the poster
                        ?>
        
        
  <!-- post message -->
  <div class="ccInnerT"> <?php 
                        echo $this->postText;
                        ?>
 </div>
  <?php 
                    } else {
                        ?>
  
            <!-- post message -->
  <div class="ccInnerT">  </div>
  
  <?php 
                    }
                    ?>
 <!-- holder for love and comment count / show more on click -->
 <div class="ccLoveAndCommentHolder"> 
 
  <!-- add APPROVE -->
  <span class="ccApproveIt">
    <?php 
                    $this->dbHandle->setRquery("SELECT * FROM amistiApprove WHERE approveItemID=?", array($this->postID));
                    $appRes = $this->dbHandle->getRquery();
                    $checkUp = false;
                    if (isset($_SESSION['logIn'])) {
                        for ($xAp = 0; $xAp < count($appRes); $xAp++) {
                            if ($appRes[$xAp]['userID'] == $_SESSION['userID']) {
                                $checkUp = true;
                                echo "<strong>Approve</strong>";
                            }
                        }
                        if (!$checkUp) {
                            echo "approve";
                        }
                    } else {
                        echo "approve";
                    }
                    $this->approveCount = count($this->dbHandle->getRquery());
                    ?>
  </span>
  
 <div class="ccCommentMidDot">&middot;</div>
  
 <!-- cc comment count and show more comment -->
 <span class="ccCommentShowMoreCount">
 <?php 
                    //CHECK IF THERE IS POST COMMEMTS FOR THE POST
                    $this->dbHandle->setRquery("SELECT * from amistiComment INNER JOIN amistiUser ON amistiComment.userID = amistiUser.userID\n\t                       WHERE amistiComment.commentItemID=?", array($this->postID));
                    $this->commentRes = $this->dbHandle->getRquery();
                    $this->commentCount = count($this->commentRes);
                    // comment count here
                    echo $this->commentCount > 0 ? $this->commentCount > 1 ? $this->commentCount . " comments" : $this->commentCount . " comment" : "0 comment";
                    ?>
 
 </span> 
  </div>
  

  
  
  
  <!-- post container -->
  <div  class="ccPostCon"> 
  
     <!-- number of people approved box -->
     <div class="ccNumberPeopleApproved">
     <!--<div class="messageIcon"> ami</div>-->
     
     <div class ="ccNPAShowNotice">
     <?php 
                    $yYou;
                    $this->dbHandle->setRquery("SELECT * FROM amistiApprove INNER JOIN amistiUser ON\n\t\t\t                           amistiApprove.userID = amistiUser.userID WHERE amistiApprove.approveItemID=?", array($this->postID));
                    $appRes = $this->dbHandle->getRquery();
                    for ($appC = 0; $appC < count($appRes); $appC++) {
                        if ($appRes[$appC]['userID'] == $_SESSION['userID']) {
                            $yYou = "You ";
                        }
                    }
                    $aproveSub = count($appRes);
                    if (count($appRes) == 0) {
                        //show nothing
                    } else {
                        if ($aproveSub == 1 && !empty($yYou)) {
                            echo "You approve this..";
                        } elseif ($aproveSub >= 0 && empty($yYou)) {
                            if ($aproveSub == 1) {
                                ?>
								  <a href="/user=<?php 
                                echo $this->postUserName;
                                ?>
&post=<?php 
                                echo $this->postID;
                                ?>
"><?php 
                                echo $aproveSub;
                                ?>
 person</a> approve this.
                                 <?php 
                            } else {
                                ?>
								  <a href="/?user=<?php 
                                echo $this->postUserName;
                                ?>
&post=<?php 
                                echo $this->postID;
                                ?>
"><?php 
                                echo $aproveSub;
                                ?>
  others</a> approve this.
                                   <?php 
                            }
                        } elseif ($aproveSub > 1 && !empty($yYou)) {
                            if ($aproveSub == 2) {
                                $aproveSub = $aproveSub - 1;
                                ?>
								    You and <a href="/?user=<?php 
                                echo $this->postUserName;
                                ?>
&post=<?php 
                                echo $this->postID;
                                ?>
"><?php 
                                echo $aproveSub;
                                ?>
 other</a> approve this.
                                   <?php 
                            } else {
                                ?>
								  You and <a href="/?user=<?php 
                                echo $this->postUserName;
                                ?>
&post=<?php 
                                echo $this->postID;
                                ?>
"><?php 
                                echo $aproveSub - 1;
                                ?>
 others</a> approve this.
											<?php 
                            }
                        }
                    }
                    $yYou = '';
                    ?>
     
     </div>
     </div>
     
     
    <?php 
                    $this->getComments();
                    //Get comment
                    ?>
</div>

<?php 
                } else {
                    if ($_SESSION['userID'] == $this->postID) {
                        //show post with z-index 0.5, work latter
                    }
                }
            }
        } else {
            //ECHO POST DOES NOT EXIST
        }
    }
<?php

// properties for system settings and settings that not linked to module
$settingsInfo = array('hlu' => array('hlu' => array('type' => 'checkbox', 'title' => __('Enable Human like URL'), 'description' => '', 'checked' => '1', 'value' => '1'), 'hlu_extention' => array('type' => 'text', 'title' => __('URL sufix'), 'description' => __('For example .html')), 'hlu_understanding' => array('type' => 'checkbox', 'title' => __('Human like URL understanding'), 'description' => __('URL will be generated as normal URL, but Human like URL will be work for compatibility with old links'), 'checked' => '1')), 'sitemap' => array('auto_sitemap' => array('type' => 'checkbox', 'title' => __('Sitemap autogeneration'), 'description' => '', 'checked' => '1', 'value' => '1')), 'sys' => array('template' => array('type' => 'select', 'title' => __('Template'), 'description' => '', 'options' => $templateSelect, 'options_attr' => array('onClick' => 'showScreenshot(\'%s\');'), 'input_sufix' => '<img id="screenshot" style="border:1px solid #A3BAE9;" width="200px" height="200px" src="' . getImgPath($config['template']) . '" />'), 'site_title' => array('type' => 'text', 'title' => __('Site name'), 'description' => sprintf(__('Used in the template as %s'), '{{ site_title }}')), 'title' => array('type' => 'textarea', 'title' => __('Site title'), 'description' => sprintf(__('Used in the template as %s'), '{{ meta_title }} | {{ title }}')), 'meta_keywords' => array('type' => 'textarea', 'title' => __('Site keywords'), 'description' => sprintf(__('Used in the template as %s'), '{{ meta_keywords }}')), 'meta_description' => array('type' => 'textarea', 'title' => __('Site description'), 'description' => sprintf(__('Used in the template as %s'), '{{ meta_description }}')), 'language' => array('type' => 'select', 'title' => __('Main language'), 'description' => __('Used when language is not specified and in the admin panel'), 'options' => call_user_func(function () {
    $langs = getPermittedLangs();
    $langs_ = array();
    foreach ($langs as $lang) {
        $langs_[$lang] = $lang;
    }
    return $langs_;
})), 'permitted_languages' => array('type' => 'text', 'title' => __('Permitted languages'), 'description' => sprintf(__('Example: "rus,eng,ger". Use a languages which are available on the site.<br>Now are available: %s'), implode(',', getPermittedLangs()))), 'cookie_time' => array('type' => 'text', 'title' => __('Cookies life time(days)'), 'description' => __('Cookies used for "remember me" option when user login')), 'redirect' => array('type' => 'text', 'title' => __('Auto redirect'), 'description' => __('Use this option for redirect user from home page to, for example, forum or loads, or other site')), 'start_mod' => array('type' => 'text', 'title' => __('Entry point'), 'description' => __('It is something like redirect but it isn\'t. You can type any URL from this site here and that page will be available as home page. For example "<b>news/view/1</b>"')), 'max_file_size' => array('type' => 'text', 'title' => __('Max an attach file size'), 'help' => __('Byte'), 'description' => __('which users can upload to the site. Used in those modules which havn\'t same setting')), 'img_preview_size' => array('type' => 'text', 'title' => __('Preview size'), 'help' => 'Px', 'description' => __('Auto scaled images')), 'min_password_lenght' => array('type' => 'text', 'title' => __('Minimum user password length'), 'description' => ''), 'admin_email' => array('type' => 'text', 'title' => __('Administrator email address'), 'description' => __('Used in site mailing')), 'redirect_delay' => array('type' => 'text', 'title' => __('Delay before redirect'), 'description' => __('When user does some action(for example add message), info message will be appeared and user will be redirected')), 'time_on_line' => array('type' => 'text', 'title' => __('Time during which the user is considered online'), 'description' => ''), 'open_reg' => array('type' => 'select', 'title' => __('Registration mode'), 'description' => __('Allowed registration on the site'), 'options' => array('1' => __('Allowed'), '0' => __('Denied'))), 'email_activate' => array('type' => 'checkbox', 'checked' => '1', 'value' => '1', 'title' => __('Email accaunt activation'), 'description' => ''), 'debug_mode' => array('type' => 'checkbox', 'checked' => '1', 'value' => '1', 'title' => __('Enable debug'), 'description' => ''), __('Which from the last materials will be displayed on home page'), 'sub_news' => array('type' => 'checkbox', 'title' => __('News'), 'description' => '', 'checked' => '1', 'value' => 'news', 'fields' => 'latest_on_home'), 'sub_stat' => array('type' => 'checkbox', 'title' => __('Stat'), 'description' => '', 'checked' => '1', 'value' => 'stat', 'fields' => 'latest_on_home'), 'sub_loads' => array('type' => 'checkbox', 'title' => __('Loads'), 'description' => '', 'checked' => '1', 'value' => 'loads', 'fields' => 'latest_on_home'), 'cnt_latest_on_home' => array('type' => 'text', 'title' => __('How many materials will be displayed on home'), 'description' => ''), 'announce_lenght' => array('type' => 'text', 'title' => __('Announce length') . ' ' . strtolower(__('On home')), 'description' => ''), __('Common'), 'cache' => array('type' => 'checkbox', 'title' => __('Cache'), 'description' => __('If cache is enabled, the site will be load faster'), 'checked' => '1', 'value' => '1'), 'templates_cache' => array('type' => 'checkbox', 'title' => __('Templetes cache'), 'description' => __('If cache is enabled, the site will be load faster'), 'checked' => '1', 'value' => '1'), 'cache_querys' => array('type' => 'checkbox', 'title' => 'Кэш SQl запросов', 'description' => '(Кешировать ли результаты SQL запросов? Если кэш включен сайт будет работать быстрее
при большой нагрузке, но при маленькой его лучше выключить.)', 'checked' => '1', 'value' => '1'), 'use_additional_fields' => array('type' => 'checkbox', 'title' => __('Enable additional fields'), 'description' => __('Enable only you know how to use it'), 'checked' => '1', 'value' => '1'), 'allow_html' => array('type' => 'checkbox', 'title' => __('Enable HTML in messages'), 'description' => __('May be not secure. If you enable, setup it in users rules'), 'checked' => '1', 'value' => '1'), 'allow_smiles' => array('type' => 'checkbox', 'title' => __('Enable smiles in messages'), 'description' => __('Replaces special markers to images'), 'checked' => '1', 'value' => '1')), 'secure' => array('antisql' => array('type' => 'checkbox', 'title' => __('SQL injections monitoring'), 'description' => sprintf(__('Loged into %s'), '/sys/logs/antisql.dat'), 'checked' => '1', 'value' => '1'), 'anti_ddos' => array('type' => 'checkbox', 'title' => __('DDOS protection'), 'description' => __('Reduces the risk of DDOS attack'), 'checked' => '1', 'value' => '1'), 'request_per_second' => array('type' => 'text', 'title' => __('(DDOS)Max quantity of a queries'), 'description' => __('per second from one IP range')), 'system_log' => array('type' => 'checkbox', 'title' => __('Enable activity log'), 'description' => __('loged a users activities'), 'checked' => '1', 'value' => '1'), 'max_log_size' => array('type' => 'text', 'title' => __('Max log size'), 'description' => __('limit of the hard drive space for the log'), 'help' => __('MB'), 'onview' => array('division' => 1000000), 'onsave' => array('multiply' => 1000000)), 'autorization_protected_key' => array('type' => 'checkbox', 'title' => __('Protection from brute force password'), 'description' => __('via the protection key sending'), 'checked' => '1', 'value' => '1'), 'session_time' => array('type' => 'text', 'title' => __('Duration of the session in the admin panel'), 'description' => __('if you has no activity during this time, you will have to login again'), 'help' => __('Seconds'))), 'rss' => array('rss_lenght' => array('type' => 'text', 'title' => __('Max RSS announce length'), 'description' => ''), 'rss_cnt' => array('type' => 'text', 'title' => __('Quantity of a materials in RSS'), 'description' => ''), __('In which modules RSS is enabled'), 'rss_news' => array('type' => 'checkbox', 'title' => __('News'), 'description' => '', 'checked' => '1', 'value' => '1'), 'rss_stat' => array('type' => 'checkbox', 'title' => __('Stat'), 'description' => '', 'checked' => '1', 'value' => '1'), 'rss_loads' => array('type' => 'checkbox', 'title' => __('Loads'), 'description' => '', 'checked' => '1', 'value' => '1')), 'watermark' => array('use_watermarks' => array('type' => 'checkbox', 'title' => __('Enable'), 'value' => '1', 'checked' => '1'), 'watermark_type' => array('type' => 'select', 'title' => __('Type'), 'description' => __('kind of watermark'), 'options' => array('1' => __('Text'), '0' => __('Image'))), __('Watermark (image)'), 'watermark_img' => array('type' => 'file', 'title' => __('Watermark (image)'), 'input_sufix_func' => 'showWaterMarkImage', 'onsave' => array('func' => 'saveWaterMarkImage')), __('Watermark (text)'), 'watermark_text' => array('type' => 'text', 'title' => __('Watermark (text)'), 'input_sufix_func' => 'showWaterMarkText'), 'watermark_text_font' => array('type' => 'select', 'title' => __('Font'), 'description' => '', 'options' => $fontSelect), 'watermark_text_angle' => array('type' => 'select', 'title' => __('Rotation angle of the text'), 'help' => __('Degrees'), 'options' => array('315' => '315', '270' => '270', '225' => '225', '180' => '180', '135' => '135', '90' => '90', '45' => '45', '0' => '0')), 'watermark_text_size' => array('type' => 'text', 'title' => __('Text size'), 'help' => 'px'), 'watermark_text_color' => array('type' => 'select', 'title' => __('Text color'), 'options' => array('000000' => array('value' => 'Черный', 'attr' => array('style' => 'color:#000000;')), 'FF0000' => array('value' => 'Красный', 'attr' => array('style' => 'color:#FF0000;')), '008000' => array('value' => 'Зелёный', 'attr' => array('style' => 'color:#008000;')), '0000FF' => array('value' => 'Синий', 'attr' => array('style' => 'color:#0000FF;')), '00FFFF' => array('value' => 'Аква', 'attr' => array('style' => 'color:#00FFFF;')), 'FF00FF' => array('value' => 'Розовый', 'attr' => array('style' => 'color:#FF00FF;')), '808080' => array('value' => 'Серый', 'attr' => array('style' => 'color:#808080;')), '00FF00' => array('value' => 'Лаймовый', 'attr' => array('style' => 'color:#00FF00;')), '800000' => array('value' => 'Темно-бордовый', 'attr' => array('style' => 'color:#800000;')), '000080' => array('value' => 'Темно-синий', 'attr' => array('style' => 'color:#000080;')), '808000' => array('value' => 'Оливковый', 'attr' => array('style' => 'color:#808000;')), '800080' => array('value' => 'Фиолетовый', 'attr' => array('style' => 'color:#800080;')), 'c0c0c0' => array('value' => 'Серебряный', 'attr' => array('style' => 'color:#c0c0c0;')), '008080' => array('value' => 'Чирок', 'attr' => array('style' => 'color:#008080;')), 'FFFFFF' => array('value' => 'Белый', 'attr' => array('style' => 'color:#FFFFFF;')), 'FFFF00' => array('value' => 'Желтый', 'attr' => array('style' => 'color:#FFFF00;')))), 'watermark_text_border' => array('type' => 'select', 'title' => __('Text border color'), 'options' => array('000000' => array('value' => 'Черный', 'attr' => array('style' => 'color:#000000;')), 'FF0000' => array('value' => 'Красный', 'attr' => array('style' => 'color:#FF0000;')), '008000' => array('value' => 'Зелёный', 'attr' => array('style' => 'color:#008000;')), '0000FF' => array('value' => 'Синий', 'attr' => array('style' => 'color:#0000FF;')), '00FFFF' => array('value' => 'Аква', 'attr' => array('style' => 'color:#00FFFF;')), 'FF00FF' => array('value' => 'Розовый', 'attr' => array('style' => 'color:#FF00FF;')), '808080' => array('value' => 'Серый', 'attr' => array('style' => 'color:#808080;')), '00FF00' => array('value' => 'Лаймовый', 'attr' => array('style' => 'color:#00FF00;')), '800000' => array('value' => 'Темно-бордовый', 'attr' => array('style' => 'color:#800000;')), '000080' => array('value' => 'Темно-синий', 'attr' => array('style' => 'color:#000080;')), '808000' => array('value' => 'Оливковый', 'attr' => array('style' => 'color:#808000;')), '800080' => array('value' => 'Фиолетовый', 'attr' => array('style' => 'color:#800080;')), 'c0c0c0' => array('value' => 'Серебряный', 'attr' => array('style' => 'color:#c0c0c0;')), '008080' => array('value' => 'Чирок', 'attr' => array('style' => 'color:#008080;')), 'FFFFFF' => array('value' => 'Белый', 'attr' => array('style' => 'color:#FFFFFF;')), 'FFFF00' => array('value' => 'Желтый', 'attr' => array('style' => 'color:#FFFF00;'))), 'onsave' => array('func' => 'saveWaterMarkText')), __('Сompression settings'), 'quality_jpeg' => array('type' => 'select', 'title' => sprintf(__('Quality %s'), '(JPEG)'), 'description' => __('Default') . ' 75', 'options' => array('100' => '100 (' . __('best') . ')', '95' => '95', '90' => '90', '85' => '85', '80' => '80', '75' => '75', '70' => '70', '65' => '65', '60' => '60', '55' => '55', '50' => '50', '45' => '45', '40' => '40', '35' => '35', '30' => '30', '25' => '25', '20' => '20', '15' => '15', '10' => '10', '5' => '5', '0' => '0 (' . __('worse') . ')')), 'quality_png' => array('type' => 'select', 'title' => sprintf(__('Quality %s'), '(PNG)'), 'options' => array('9' => '9 (' . __('worse') . ')', '8' => '8', '7' => '7', '6' => '6', '5' => '5', '4' => '4', '3' => '3', '2' => '2', '1' => '1', '0' => '0 (' . __('best') . ')')), __('Common'), 'watermark_hpos' => array('type' => 'select', 'title' => __('Horizontal alignment of the watermark'), 'options' => array('3' => __('Right'), '2' => __('Center'), '1' => __('Left'))), 'watermark_vpos' => array('type' => 'select', 'title' => __('Vertical alignment of the watermark'), 'options' => array('3' => __('Bottom'), '2' => __('Center'), '1' => __('Top'))), 'watermark_alpha' => array('type' => 'select', 'title' => __('Watermark opacity'), 'options' => array('100' => '100', '95' => '95', '90' => '90', '85' => '85', '80' => '80', '75' => '75', '70' => '70', '65' => '65', '60' => '60', '55' => '55', '50' => '50', '45' => '45', '40' => '40', '35' => '35', '30' => '30', '25' => '25', '20' => '20', '15' => '15', '10' => '10', '5' => '5', '0' => '0 (' . __('full opacity') . ')'))), 'autotags' => array('autotags_active' => array('type' => 'checkbox', 'title' => __('Enable'), 'value' => '1', 'checked' => '1'), 'autotags_exception' => array('type' => 'textarea', 'title' => __('Exceptions'), 'description' => __('Words that should not be counted')), 'autotags_priority' => array('type' => 'textarea', 'title' => __('Priority'), 'description' => __('Words that have priority'))), 'links' => array('use_noindex' => array('type' => 'checkbox', 'title' => __('Use noindex & nofollow'), 'description' => __('disable a links indexing'), 'value' => '1', 'checked' => '1'), 'redirect_active' => array('type' => 'checkbox', 'title' => __('Enable redirect'), 'description' => __('check the availability of a domain in white or black lists'), 'value' => '1', 'checked' => '1'), 'url_delay' => array('type' => 'text', 'title' => __('Delay before redirect'), 'help' => __('Seconds')), 'blacklist_sites' => array('type' => 'text', 'title' => __('Black list'), 'description' => __('domains that banned for automatic redirect'), 'help' => __('Separated by comma')), 'whitelist_sites' => array('type' => 'text', 'title' => __('White list'), 'description' => __('domains for which the redirect carried without delay'), 'help' => __('Separated by comma'))));
$sysMods = array('sys', 'hlu', 'secure', 'rss', 'sitemap', 'watermark', 'autotags', 'links');
$noSub = array('sys', 'hlu', 'sitemap', 'watermark', 'autotags', 'links');
if (!function_exists('saveWaterMarkImage')) {
    function saveWaterMarkImage($settings)
    {
        if (isImageFile($_FILES['watermark_img']['type'])) {
            $ext = strchr($_FILES['watermark_img']['name'], '.');
            if (move_uploaded_file($_FILES['watermark_img']['tmp_name'], ROOT . '/sys/img/watermark' . $ext)) {
                $settings['watermark_img'] = 'watermark' . $ext;
            }
        }
        return $settings;
    }
}
if (!function_exists('showWaterMarkImage')) {
    function showWaterMarkImage($settings)
    {
        $params = array('style' => 'max-width:200px; max-height:200px;');
        if (!empty($settings['watermark_img']) && file_exists(ROOT . '/sys/img/' . $settings['watermark_img'])) {
Exemple #4
0
                            $options_attr = $visName['attr'];
                            $visName = $visName['value'];
                        }
                        if (!empty($params['options_attr']) && is_array($params['options_attr'])) {
                            $options_attr = array_merge($params['options_attr'], $options_attr);
                        }
                        $options_ = '';
                        $state = $_config[$fname] == $value ? ' selected="selected"' : '';
                        $attr = '';
                        if (!empty($options_attr)) {
                            foreach ($options_attr as $k => $v) {
                                $attr .= ' ' . $k . '="' . $v . '"';
                            }
                        }
                        $options_ .= '<option data-test="' . $value . '" ' . $state . $attr . ' value="' . h($value) . '">' . $visName . '</option>';
                        $options .= sprintf($options_, getImgPath($value));
                    }
                }
                $output_ = '<select name="' . h($fname) . '">' . $options . '</select>';
                break;
            case 'file':
                $output_ = '<input type="file"  name="' . h($fname) . '"' . $attr . ' />';
                break;
        }
        $output .= '<div class="setting-item">
			<div class="left">
				' . h($params['title']) . '
				<span class="comment">' . $params['description'] . '</span>
			</div>
			<div class="right">' . $output_;
        // If we have function by create sufix after input field
Exemple #5
0
OOP;
            }
        } else {
            for ($x = 0; $x < count($photoResults); $x++) {
                if ($album == "allPhotos") {
                    $photoFileOP->setRquery("SELECT * FROM amistiFolder WHERE folderID=?", array($photoResults[$x]['folderID']));
                    $folderR = $photoFileOP->getRquery();
                    $album = $folderR[0]['folderName'];
                }
                if ($photoResults[$x]['picShow'] == 1) {
                    //IF PICSHOW EQUAL 1 THEN SHOW
                    $picID = $photoResults[$x]['picID'];
                    $xx = $x + 1;
                    $curUser = $_SESSION['curUser'];
                    //$album = urlencode($album);
                    $img = getImgPath($photoResults[$x]['picSmallImgPath']);
                    //$album = urlencode($album);
                    $paginate .= <<<OP
\t\t<div class="photoThumbContainer" id="photoThumbC_{$picID}" >
\t\t<div  class="photoThumbMenu" title="photo menu">...</div>
\t\t<!-- PHOTO MENU SELECTOR -->
\t\t
\t\t<div class="photoThumbMenuData"> <!-- PHOTO MENU DISPLAY HERE-->
\t\t<li class="photoReport" id="photoThumb_{$picID}">Report photo</li>
\t\t</div>
\t\t\t\t<!-- link to bigpic --> \t\t
\t\t<a href="?user={$curUser}&album={$album}&PN={$xx}&imgID={$picID}&PVB=true" class="photoViewBig">
\t\t<div class="photoThumb" id="photoThumb_{$picID}" style="background-image:url('{$img}')"> </div>
\t\t</a> 
\t\t\t</div>
    $allD;
    $fOp->setRquery("SELECT * FROM amistiPic WHERE picID=?", array($popUpPostID));
    $popBig = $fOp->getRquery();
    //CHECK IF ITS A PICTURE
    if (count($popBig) > 0) {
        $popUpPostID = $popBig[0]['postID'];
    }
    $fOp->setRquery("SELECT * FROM amistiApprove INNER JOIN amistiUser ON amistiApprove.userID =  amistiUser.userID \n\t                 WHERE amistiApprove.approveItemID=?", array($popUpPostID));
    $res = $fOp->getRquery();
    for ($x = 0; $x < count($res); $x++) {
        $fOp->setRquery("SELECT * FROM amistiProfilePic WHERE userID=? AND profilePicCurrent=?", array($res[$x]['userID'], 1));
        $proPic = $fOp->getRquery();
        $name = $res[$x]['fName'] . " " . $res[$x]['sName'];
        $ico = $proPic[0]['profileImgPath'];
        $uName = $res[$x]['uName'];
        $uIcon = empty($ico) ? "/libs/libImages/icons/Man.png " : getImgPath($proPic[0]['profileImgPath']);
        if ($res[$x]['userID'] !== $_SESSION['userID']) {
            $allD .= <<<OP

  <div class="ccPostUserAPDataInner">
  <a href="/{$uName}">
  <div class="ccPostUserAPDataInnerIcon" style="background-image:url({$uIcon})"> </div>
  </a>
  
  <div class="ccPostUserAPDataInnerData"> <strong><a href="/{$uName}">{$name} </strong></a> <br><small> location not set</small></div>
  <div class="ccPostUserAPDataInnerOp"> Connected </div>
  </div>
OP;
        }
    }
    $json = array("op" => "OK", "data" => $allD);
Exemple #7
0
function getComments($imgID, $theID, $picOrPost)
{
    $topHand = new sysDB();
    $topHand->connect();
    $topHand->setRquery("SELECT * FROM amistiUser WHERE uName=?", array($_SESSION['curUser']));
    $USERCHECK = $topHand->getRquery();
    // DECLARE VARIABLES
    $PPComText;
    $PPComID;
    $PPComTime;
    //CHECK IF THERE IS POST /PIC COMMEMTS FOR THE POST/PIC
    $topHand->setRquery("SELECT * from amistiComment INNER JOIN amistiUser ON amistiComment.userID = amistiUser.userID\n\t\t\t\t\t\t WHERE amistiComment.commentItemID=?", array($theID));
    //set variables
    $PPComText = "commentText";
    $PPComID = "commentID";
    $PPComTime = "commentTime";
    $commentRes = $topHand->getRquery();
    //$commentRes = count($commentRes ); // comment count here
    // get comments from database
    ?>
<!--- show comments -->
	   <div class="ccShowComments">

	  
	  <!-- COMMENTS PANE HERE -->
	  <div class="ccshowCommentsBoxMain">
  <?php 
    // first check if the user is registered or login
    if (count($commentRes) > 0) {
        for ($n = 0; $n < count($commentRes); $n++) {
            //get user icon
            $topHand->setRquery("SELECT * FROM amistiUser WHERE userID=?", array($commentRes[$n]['userID']));
            $uIconRes = $topHand->getRquery();
            $topHand->setRquery("SELECT * FROM amistiProfilePic WHERE profilePicCurrent=? AND userID=?", array(1, $commentRes[$n]['userID']));
            $userIco = $topHand->getRquery();
            $uIcon = $userIco[0]['profileImgPath'] == "" || 0 ? "/libs/libImages/icons/Man.png" : getImgPath($userIco[0]['profileImgPath']);
            $topHand->setRquery("SELECT * FROM amistiComment WHERE userID=? AND commentItemID=? AND commentShow=?", array($commentRes[$n]['userID'], $theID, 1));
            $comData = $topHand->getRquery();
            // get query results
            for ($X = 0; $X < count($comData); $X++) {
            }
            ?>
	  
	  <div class="ccShowCommentInner"  id="comm_<?php 
            echo $commentRes[$n][$PPComID];
            ?>
">


	  <a href="/<?php 
            echo $commentRes[$n]['uName'];
            ?>
" >
	  <div class="ccShowCommentUIcon showUserPopUpPic" style="background-image:url( '<?php 
            echo $uIcon;
            ?>
')">   </div>
	  </a>
	  <div class="ccShowCommentTextAllCon" >
	  
	  <div class="ccShowCommentText"> 		 
	  <a href="/<?php 
            echo $commentRes[$n]['uName'];
            ?>
" class="showUserPopUpName"><?php 
            echo $uIconRes[0]['fName'] . " " . $uIconRes[0]['sName'];
            ?>
</a>  
		   
		  <?php 
            echo $commentRes[$n][$PPComText];
            ?>
	   </div>
	   
		
		 
		 <?php 
            if (isset($_SESSION['userID'])) {
                //only show menu to login users
                ?>
			  <div class="ccShowCommentMenuDHR">...</div> 
			 <?php 
                if ($_SESSION['curUserID'] == $_SESSION['curUserID']) {
                    if ($_SESSION['userID'] == $commentRes[$n]['userID']) {
                        ?>

<div  class ="ccCommentMenu">
<span class="ccCommentMenuArrowTop"></span>
<div class="ccCommentMenuData" >
<li class="comEdit"> Edit...</li>
<li class="comDelete"> Delete...</li>
</div>
<span class="ccCommentMenuArrowBot"></span>
</div>

<?php 
                    } else {
                        ?>
  <div  class ="ccCommentMenu">
  <span class="ccCommentMenuArrowTop"></span>
  <div class="ccCommentMenuData" >
  <li class="comDelete"> Remove...</li>
  <li class="comReport"> Report...</li>
  </div>
  <span class="ccCommentMenuArrowBot"></span>
  </div>
	  
  <?php 
                    }
                } elseif ($commentRes[$n]['userID'] == $_SESSION['userID']) {
                    ?>
<div  class ="ccCommentMenu">
<span class="ccCommentMenuArrowTop"></span>
<div class="ccCommentMenuData" >
<li class="comEdit"> Edit...</li>
<li class="comDelete"> Delete...</li>
</div>
<span class="ccCommentMenuArrowBot"></span>
</div>  
  
  <?php 
                } else {
                    ?>
<div  class ="ccCommentMenu">
<span class="ccCommentMenuArrowTop"></span>
<div class="ccCommentMenuData" >
<li class="comReport"> Report...</li>

</div>
<span class="ccCommentMenuArrowBot"></span>
</div>    
	  
	  <?php 
                }
            }
            ?>
		  
		   
		 <div class="ccCommentTLLCBoxMain" >   
		 <div class=" ccCommentTime"><?php 
            echo relativeTime($commentRes[$n][$PPComTime]);
            ?>
 </div> 
		 <div class ="ccCommentMidDot">&middot;</div>
		 
		<div class=" ccCommentApprove">
		<?php 
            // if($picOrPost == true){
            $topHand->setRquery("SELECT * FROM amistiApprove WHERE approveItemID=?", array($commentRes[$n][$PPComID]));
            /*		  }else{
            			
            		  $topHand->setRquery("SELECT * FROM amistiPicApprove WHERE picID=?",array($commentRes [$n][$PPComID]));  
            		}*/
            $conR = $topHand->getRquery();
            $appCountN = count($conR) == 0 ? "" : count($conR);
            // get the approve count
            $foundYes;
            if (isset($_SESSION['logIn'])) {
                for ($cA = 0; $cA < count($conR); $cA++) {
                    if ($conR[$cA]['userID'] == $_SESSION['userID']) {
                        $foundYes = true;
                    }
                }
                if ($foundYes) {
                    echo ' <a href="#">Approve</a> ' . $appCountN;
                } else {
                    echo ' <a href="#">approve</a> ' . $appCountN;
                }
                $foundYes = false;
            } else {
                echo ' <a href="#">approve</a> ' . $appCountN;
            }
            ?>
	   <!-- <a href="#">approve</a>-->
		</div>

		</div>
		 
		 

	 
	  </div>
	  </div>

	  <?php 
        }
    }
    ?>
	  
	  </div>
	  </div>
		 <?php 
    if (!isset($_SESSION['logIn']) || !isset($_SESSION['userID'])) {
        echo "login to post comment...";
    } else {
        ?>


 
  <!-- text area ----->
<textarea placeholder="Post a comment..." class="commentPost autoExpand" ></textarea>

<!-- text area inner images -->
<div class="ccTxtAreaIcons"> <img src="/libs/libImages/smilies/angel.png" alt="chat icon"> </div>

<!-- text area icon -->
<?php 
        $topHand->setRquery("SELECT * FROM amistiUser  INNER JOIN amistiProfilePic ON amistiUser.userID = amistiProfilePic.userID\n\t\t\t WHERE amistiUser.userID=? AND amistiProfilePic.profilePicCurrent=?", array($_SESSION['userID'], 1));
        $pIconRes = $topHand->getRquery();
        $imgP = count($pIconRes) == 0 ? "/libs/libImages/icons/Man.png" : getImgPath($pIconRes[0]['profileImgPath']);
        ?>
<div class="ccPostCommentIcon" style="background-image:url('<?php 
        echo $imgP;
        ?>
')"> </div>
<?php 
    }
}
Exemple #8
0
<!-- ALL PHOTO RIGHT COMMENT CONTAINER PANE -->
<div  id="allPhotoRightCommentContainer"> 
 
<!-- ALL PHOTO PAGE CC INNER -->
<div id="allPhotoRCCInner">


</div>
</div>


<!-- ALL PHOTO RIGHT COMMENT PANE --->
<?php 
$topHand->setRquery("SELECT * FROM amistiProfilePic WHERE userID=? AND profilePicCurrent=?", array($_SESSION['userID'], 1));
$topDataRes = $topHand->getRquery();
$uIcon = count($topDataRes) == 0 ? "../libs/libImages/icons/Man.png" : getImgPath($topDataRes[0]['profileImgPath']);
if (isset($_SESSION['logIn'])) {
    ?>

<form>
<textarea placeholder="Post your comment" class="commentPost autoExpand"></textarea>
</form>


<div class="ccPostCommentIcon allPCIr" style="background-image:url(<?php 
    echo $uIcon;
    ?>
)">

</div>