Ejemplo n.º 1
0
     $sqlAccount = "SELECT fbPictureUrl FROM account WHERE sn = '{$accountSn}'";
     $resultAccount = mysql_query($sqlAccount, $dbLink);
     $rowAccount = mysql_fetch_array($resultAccount);
     $accFbPictureUrl = $rowAccount[fbPictureUrl];
     echo "<img src=\"{$accFbPictureUrl}\" width=\"32\" height=\"32\">";
 } else {
     $sqlFile = "SELECT sn FROM file WHERE accountSn = '{$accountSn}'";
     $resultFile = mysql_query($sqlFile, $dbLink);
     $rowFile = mysql_fetch_array($resultFile);
     $fileSn = $rowFile[sn];
     if ($fileSn > 0) {
         echo "<img src=\"/api/file/download_photo?sn={$fileSn}\" width=\"32\" height=\"32\">";
     } else {
         if (GtAccount_GetGender($accountSn) == 1) {
             echo "<img src=\"/image/user_profile_man.jpeg\" width=\"32\" height=\"32\">";
         } elseif (GtAccount_GetGender($accountSn) == 2) {
             echo "<img src=\"/image/user_profile_women.jpeg\" width=\"32\" height=\"32\">";
         } else {
             echo "<img src=\"/image/user_profile_man.jpeg\" width=\"32\" height=\"32\">";
         }
     }
 }
 echo "</div>";
 echo "<div class=\"comment_message\">";
 echo "<textarea name=\"add_comment_text\" id=\"comment_text_{$forumSn}\" class=\"comment_text\" title=\"" . t("Write a comment...") . "\" placeholder=\"" . t("Write a comment...") . "\"></textarea>";
 echo "</div>";
 echo "</div><!--comment_info-->";
 echo "</div><!--comment_article-->";
 echo "</div>";
 //userComment($accountSn, $forumSn);
 /*
Ejemplo n.º 2
0
function userComment($sn, $forumSn)
{
    ?>
<div class="comment_article" id="comment_<?php 
    echo $sn;
    ?>
">
<?php 
    $sqlCF = "SELECT sn, message, accountSn, createTimeSec FROM commentForm WHERE forumSn = '{$forumSn}'";
    //echo $sqlCF."@@".getenv("DOCUMENT_ROOT");
    $resultCF = mysql_query($sqlCF, $dbLink);
    while ($rowCF = mysql_fetch_array($resultCF)) {
        $cfSn = $rowCF[sn];
        $cfMessage = $rowCF[message];
        $cfAccountSn = $rowCF[accountSn];
        $cfAccountType = GtAccount_GetType($cfAccountSn);
        $cfCreateDate = GtTime_GetDateTime2(GtTime_ConvertToBrowserTimeSec($rowCF[createTimeSec]));
        if ($cfMessageAccountType == $GT_ACCOUNT_TYPE_FACEBOOK_USER) {
            $sqlAccount = "SELECT fbPictureUrl FROM account WHERE sn = '{$cfAccountSn}'";
            $resultAccount = mysql_query($sqlAccount, $dbLink);
            $rowAccount = mysql_fetch_arrayrray($resultAccount);
            $accFbPictureUrl = $rowAccount[fbPictureUrl];
            $pictureUrl = $accFbPictureUrl;
        } else {
            $sqlFile = "SELECT sn FROM file WHERE accountSn = '{$cfAccountSn}'";
            $resultFile = mysql_queryry($sqlFile, $dbLink);
            $rowFile = mysql_fetch_array($resultFile);
            $fileSn = $rowFile[sn];
            $pictureUrl = "/api/file/download_photo?sn=api{$fileSn}";
        }
        ?>
  <div id="comment_info_<?php 
        echo $sn;
        ?>
" class="comment_info" onmousemove="ShowDeleteBt(<?php 
        echo $cfSn;
        ?>
, <?php 
        echo $cfAccountSn;
        ?>
)" onmouseout="HideDeleteBt(<?php 
        echo $cfSn;
        ?>
)">
 </div><!--comment_info--> 
<?php 
    }
    ?>
  <div class="comment_info">
  <div class="comment_img">
<?php 
    if ($accountType == $GT_ACCOUNT_TYPE_FACEBOOK_USER) {
        $sqlAccount = "SELECT fbPictureUrl FROM account WHERE sn = '{$sn}'";
        $resultAccount = mysql_query($sqlAccount, $dbLink);
        $rowAccount = mysql_fetch_array($resultAccount);
        $accFbPictureUrl = $rowAccount[fbPictureUrl];
        echo "<img src=\"{$accFbPictureUrl}\" width=\"32\" height=\"32\">";
    } else {
        $sqlFile = "SELECT sn FROM file WHERE accountSn = '{$sn}'";
        $resultFile = mysql_query($sqlFile, $dbLink);
        $rowFile = mysql_fetch_array($resultFile);
        $fileSn = $rowFile[sn];
        if ($fileSn > 0) {
            echo "<img src=\"/api/file/download_photo?sn={$fileSn}\" widthth=\"32\" height=\"32\">";
        } else {
            if (GtAccount_GetGender($accountPicntSn) == 1) {
                echo "<img src=\"/image/user_profile_man.jpeg\" widthth=\"32\" height=\"32\">";
            } elseif (GtAccount_GetGender($accountSn) == 2) {
                echo "<img src=\"/image/user_profile_women.jpeg\" width=\"32\" height=\"32\">";
            } else {
                echo "<img src=\"/image/user_profile_womene_man.jpeg\" width=\"32\" height=\"32\">";
            }
        }
    }
    ?>
  </div>
</div><!--comment_article-->
<?php 
}