当前位置: 首页>>代码示例>>PHP>>正文


PHP reparseObjTags函数代码示例

本文整理汇总了PHP中reparseObjTags函数的典型用法代码示例。如果您正苦于以下问题:PHP reparseObjTags函数的具体用法?PHP reparseObjTags怎么用?PHP reparseObjTags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了reparseObjTags函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PageCompPageMainCode

/**
 * page code function
 */
function PageCompPageMainCode($iLoggedID)
{
    $member['ID'] = (int) $iLoggedID;
    $p_arr = getProfileInfo($member['ID']);
    if ($_POST['CHANGE_STATUS']) {
        $sStatus = "";
        switch ($_POST['CHANGE_STATUS']) {
            case 'SUSPEND':
                if ($p_arr['Status'] == 'Active') {
                    $sStatus = "Suspended";
                }
                break;
            case 'ACTIVATE':
                if ($p_arr['Status'] == 'Suspended') {
                    $sStatus = "Active";
                }
                break;
        }
        if (mb_strlen($sStatus) > 0) {
            db_res("UPDATE `Profiles` SET `Status` = '{$sStatus}' WHERE `ID` = {$member['ID']}");
        }
        createUserDataFile($p_arr['ID']);
        reparseObjTags('profile', $member['ID']);
        $p_arr = getProfileInfo($member['ID']);
    }
    $aData = array('profile_status_caption' => _t("_Profile status"), 'status' => $p_arr['Status'], 'status_lang_key' => _t('__' . $p_arr['Status']));
    $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'change_status.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('status' => array('type' => 'hidden', 'name' => 'CHANGE_STATUS', 'value' => ''), 'subscribe' => array('type' => 'submit', 'name' => 'subscribe', 'value' => '')));
    switch ($p_arr['Status']) {
        case 'Active':
            $aForm['inputs']['status']['value'] = 'SUSPEND';
            $aForm['inputs']['subscribe']['value'] = _t('_Suspend account');
            $oForm = new BxTemplFormView($aForm);
            $aData['form'] = $oForm->getCode();
            $aData['message'] = _t("_PROFILE_CAN_SUSPEND");
            break;
        case 'Suspended':
            $aForm['inputs']['status']['value'] = 'ACTIVATE';
            $aForm['inputs']['subscribe']['value'] = _t('_Activate account');
            $oForm = new BxTemplFormView($aForm);
            $aData['form'] = $oForm->getCode();
            $aData['message'] = _t("_PROFILE_CAN_ACTIVATE");
            break;
        default:
            $aData['message'] = _t("_PROFILE_CANT_ACTIVATE/SUSPEND");
            $aData['form'] = '';
            break;
    }
    return $GLOBALS['oSysTemplate']->parseHtmlByName('change_status.html', $aData);
}
开发者ID:noormcs,项目名称:studoro,代码行数:52,代码来源:change_status.php

示例2: uploadFile

function uploadFile($sFile, $sDesc, $sTags, $iUser)
{
    global $dir;
    if ($_FILES['uploadFile']['error'] != 0) {
        $sCode = '<div class="uploadStatus">' . _t("_File upload error") . '</div>';
    } else {
        $aFileInfo = getimagesize($_FILES['uploadFile']['tmp_name']);
        if (!$aFileInfo) {
            $sCode = '<div class="uploadStatus">' . _t("_You uploaded not image file") . '</div>';
        } else {
            $ext = false;
            switch ($aFileInfo['mime']) {
                case 'image/jpeg':
                    $ext = 'jpg';
                    break;
                case 'image/gif':
                    $ext = 'gif';
                    break;
                case 'image/png':
                    $ext = 'png';
                    break;
                default:
                    $ext = false;
            }
            if (!$ext) {
                $sCode = '<div class="uploadStatus">' . _t("_You uploaded not JPEG, GIF or PNG file") . '</div>';
            } else {
                $sCode = '<div class="uploadStatus">' . _t("_Upload successful") . '</div>';
                $sActive = getParam("enable_shPhotoActivation") == 'on' ? 'true' : 'false';
                $sQuery = "INSERT INTO `sharePhotoFiles` (`medProfId`,`medTitle`,`medExt`,`medDesc`,`medTags`,`medDate`,`Approved`) VALUES('{$iUser}','{$sFile}','{$ext}','{$sDesc}','{$sTags}',NOW(),'{$sActive}')";
                db_res($sQuery);
                $iNew = mysql_insert_id();
                reparseObjTags('photo', $iNew);
                $sNewFileName = $dir['sharingImages'] . $iNew . '.' . $ext;
                $sNewMainName = $dir['sharingImages'] . $iNew . '_m.' . $ext;
                $sNewThumbName = $dir['sharingImages'] . $iNew . '_t.' . $ext;
                if (!move_uploaded_file($_FILES['uploadFile']['tmp_name'], $sNewFileName)) {
                    $sCode = '<div class="uploadStatus">' . _t("_Couldn\\'t move file") . '</div>';
                } else {
                    chmod($sNewFileName, 0644);
                    $iWidth = (int) getParam("max_photo_width");
                    $iHeight = (int) getParam("max_photo_height");
                    $iThumbW = (int) getParam("max_thumb_width");
                    $iThumbH = (int) getParam("max_thumb_height");
                    if (imageResize($sNewFileName, $sNewMainName, $iWidth, $iHeight) != IMAGE_ERROR_SUCCESS) {
                        $sCode = '<div class="uploadStatus">' . _t("_Upload failed") . '</div>';
                    } else {
                        imageResize($sNewMainName, $sNewThumbName, $iThumbW, $iThumbH);
                        header("Location:viewPhoto.php?fileID=" . $iNew);
                        exit;
                    }
                }
            }
        }
    }
    return $sCode;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:57,代码来源:uploadSharePhoto.php

示例3: ActionUpdateAdvertisementID

 /**
  * SQL Updating fields of Advertisement
  *
  * @param $iEditAdvertisementID	ID`s of editing Advertisement
  * @return Text presentation of data
  */
 function ActionUpdateAdvertisementID($iEditAdvertisementID)
 {
     $sCheckPostSQL = "SELECT `IDProfile`\r\n\t\t\t\t\t\t\tFROM `ClassifiedsAdvertisements`\r\n\t\t\t\t\t\t\tWHERE `ID`={$iEditAdvertisementID}\r\n\t\t\t\t\t\t";
     $aAdvOwner = db_arr($sCheckPostSQL);
     $iAdvOwner = $aAdvOwner['IDProfile'];
     $iVisitorID = (int) $_COOKIE['memberID'];
     if (($iVisitorID == $iAdvOwner || $this->bAdminMode) && $iEditAdvertisementID > 0) {
         if ($this->bAdminMode == FALSE) {
             $sRestrictRes = $this->RestrictAction($iVisitorID);
             if ($sRestrictRes != '') {
                 return $sRestrictRes;
             }
             //if ($this->RestrictAction($iVisitorID)) return;
         }
         require_once BX_DIRECTORY_PATH_INC . 'tags.inc.php';
         $sSuccUpd = _t("_SUCC_UPD_ADV");
         $sFailUpd = _t("_FAIL_UPD_ADV");
         $sCategoryID = process_db_input($_POST['Classified']);
         $sSubCategoryID = process_db_input($_POST['SubClassified']);
         $sCustomFieldValue1 = (int) $_POST['CustomFieldValue1'];
         $sCustomFieldValue2 = (int) $_POST['CustomFieldValue2'];
         $sTags = process_db_input($_POST['Tags']);
         $aTags = explodeTags($sTags);
         $sTags = implode(",", $aTags);
         $sSubject = $this->process_html_db_input($_POST['subject']);
         $sMessage = $this->process_html_db_input($_POST['message']);
         $changeCat = ($sCategoryID > 0 and $sSubCategoryID > 0) ? "`IDClassifiedsSubs`='{$sSubCategoryID}', " : '';
         //1. get a new files and return string-array
         $sNewMedias = $this->parseUploadedFiles($iAdvOwner);
         //2. get current media datas from cls
         $aAdvData = $this->GetAdvertisementData($iEditAdvertisementID);
         $sMediaIDs = $aAdvData['Media'];
         //3. merge both
         $aOldChunks = preg_split("/[,]+/", $sMediaIDs, -1, PREG_SPLIT_NO_EMPTY);
         $aNewChunks = preg_split("/[,]+/", $sNewMedias, -1, PREG_SPLIT_NO_EMPTY);
         $aResultChunks = array_merge($aNewChunks, $aOldChunks);
         $sResultChunks = implode(",", $aResultChunks);
         $sPicsAddSQL = count($aNewChunks) > 0 ? "`Media` = '{$sResultChunks}'," : '';
         //$sNewUri = uriGenerate($sSubject, 'ClassifiedsAdvertisements', 'EntryUri', 50);
         //4. update result
         $sQuery = "\r\n\t\t\t\tUPDATE `ClassifiedsAdvertisements` SET\r\n\t\t\t\t{$changeCat}\r\n\t\t\t\t`Subject`='{$sSubject}',\r\n\t\t\t\t`Message`='{$sMessage}',\r\n\t\t\t\t`CustomFieldValue1`={$sCustomFieldValue1},\r\n\t\t\t\t`CustomFieldValue2`={$sCustomFieldValue2},\r\n\t\t\t\t{$sPicsAddSQL}\r\n\t\t\t\t`Tags`='{$sTags}'\r\n\t\t\t\tWHERE `ID`={$iEditAdvertisementID}\r\n\t\t\t";
         $vSqlRes = db_res($sQuery);
         $sRet = mysql_affected_rows() > 0 ? _t($sSuccUpd) : _t($sFailUpd);
         reparseObjTags('ad', $iEditAdvertisementID);
         $this->UseDefaultCF();
         return MsgBox($sRet) . $this->ActionPrintAdvertisement($iEditAdvertisementID);
     } elseif ($iVisitorID != $iAdvOwner) {
         return MsgBox(_t('_Hacker String'));
     } else {
         return MsgBox(_t('_Error Occured'));
     }
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:58,代码来源:BxDolClassifieds.php

示例4: video_parseTags

function video_parseTags($iId)
{
    reparseObjTags('video', $iId);
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:4,代码来源:customFunctions.inc.php

示例5: ActionAddNewPost

 /**
  * Adding a New Post SQL
  *
  * @param $iLastID - returning Last Inserted ID (SQL) (just try)
  * @return HTML presentation of data
  */
 function ActionAddNewPost(&$iLastID)
 {
     global $dir;
     $this->CheckLogged();
     $iCategoryID = process_db_input((int) $_POST['categoryID']);
     $sCheckPostSQL = "SELECT `OwnerID`\n\t\t\t\t\t\t\tFROM `BlogCategories`\n\t\t\t\t\t\t\tWHERE `CategoryID`={$iCategoryID}\n\t\t\t\t\t\t";
     $aCategoryOwner = db_arr($sCheckPostSQL);
     $iCategoryOwnerID = $aCategoryOwner['OwnerID'];
     if ($this->aBlogConf['visitorID'] == $iCategoryOwnerID && $iCategoryID > 0) {
         $sPostCaption = process_db_input($_POST['caption']);
         $sPostUri = uriGenerate($sPostCaption, 'BlogPosts', 'PostUri');
         $sPostText = process_db_input($_POST['blogText']);
         $commentPerm = process_db_input($_POST['commentPerm']);
         $readPerm = process_db_input($_POST['readPerm']);
         $sTagsPerm = process_db_input($_POST['tags']);
         $aTags = explodeTags($sTagsPerm);
         $sTagsPerm = implode(",", $aTags);
         $queryActionAdd = " INSERT INTO ";
         $sAutoApprovalVal = getParam('blogAutoApproval') == 'on' ? "approval" : "disapproval";
         $addQuery = "\n\t\t\t\t{$queryActionAdd} `BlogPosts`\n\t\t\t\tSET\n\t\t\t\t\t`CategoryID` = '{$iCategoryID}',\n\t\t\t\t\t`PostCaption` = '{$sPostCaption}',\n\t\t\t\t\t`PostUri` = '{$sPostUri}',\n\t\t\t\t\t`PostText` = '{$sPostText}',\n\t\t\t\t\t`PostReadPermission` = '{$readPerm}',\n\t\t\t\t\t`PostCommentPermission` = '{$commentPerm}',\n\t\t\t\t\t`PostStatus` = '{$sAutoApprovalVal}',\n\t\t\t\t\t`Tags` = '{$sTagsPerm}',\n\t\t\t\t\t`PostDate` = NOW()\n\t\t\t";
         $sRet = _t('_failed_to_add_post');
         if (db_res($addQuery)) {
             $iLastId = mysql_insert_id();
             $this->iLastPostedPostID = $iLastId;
             if (0 < $_FILES['BlogPic']['size'] && 0 < strlen($_FILES['BlogPic']['name']) && 0 < $iLastId) {
                 $sFileName = 'blog_' . $iLastId;
                 $sExt = moveUploadedImage($_FILES, 'BlogPic', $dir['blogImage'] . $sFileName, '', false);
                 if (strlen($sExt) && !(int) $sExt) {
                     imageResize($dir['blogImage'] . $sFileName . $sExt, $dir['blogImage'] . 'small_' . $sFileName . $sExt, $this->iIconSize / 2, $this->iIconSize / 2);
                     imageResize($dir['blogImage'] . $sFileName . $sExt, $dir['blogImage'] . 'big_' . $sFileName . $sExt, $this->iThumbSize, $this->iThumbSize);
                     chmod($dir['blogImage'] . 'small_' . $sFileName . $sExt, 0644);
                     chmod($dir['blogImage'] . 'big_' . $sFileName . $sExt, 0644);
                     $query = "UPDATE `BlogPosts` SET `PostPhoto` = '" . $sFileName . $sExt . "' WHERE `PostID` = '{$iLastId}'";
                     db_res($query);
                     @unlink($dir['blogImage'] . $sFileName . $sExt);
                 }
             }
             if ($iLastId > 0) {
                 $sRet = _t('_post_successfully_added');
                 reparseObjTags('blog', $iLastId);
             }
         }
         return MsgBox($sRet);
     } elseif ($this->aBlogConf['visitorID'] != $iCategoryOwnerID) {
         return MsgBox(_t('_Hacker String'));
     } else {
         return MsgBox(_t('_Error Occured'));
     }
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:55,代码来源:BxDolBlogs.php

示例6: PageCompPageMainCode

/**
 * page code function
 */
function PageCompPageMainCode()
{
    global $ID;
    global $ConfCode;
    global $site;
    global $newusernotify;
    global $dir;
    $autoApproval_ifJoin = isAutoApproval('join');
    $p_arr = getProfileInfo($ID);
    if (!$p_arr) {
        $_page['header'] = _t("_Error");
        $_page['header_text'] = _t("_Profile Not found");
        $ret = "<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>";
        $ret .= _t('_Profile Not found Ex');
        $ret .= "</td></table>";
        return $ret;
    }
    ob_start();
    echo "<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>";
    if ($p_arr['Status'] == 'Unconfirmed') {
        $ConfCodeReal = base64_encode(base64_encode(crypt($p_arr[Email], "secret_confirmation_string")));
        if (strcmp($ConfCode, $ConfCodeReal) != 0) {
            ?>
<b><?php 
            echo _t("_Profile activation failed");
            ?>
</b><br /><br />
<?php 
            echo _t("_EMAIL_CONF_FAILED_EX");
            ?>
<br />
<center><form action="<?php 
            echo $_SERVER[PHP_SELF];
            ?>
" method=get>
<input type=hidden name="ConfID" value="<?php 
            echo $ID;
            ?>
">
<table class=text>
    <td><b><?php 
            echo _t("_Confirmation code");
            ?>
:</b> </td>
    <td><input class=no name="ConfCode"></td>
    <td>&nbsp;</td>
    <td><input class=no type="submit" value=" <?php 
            echo _t("_Submit");
            ?>
 "></td>
</table>
</form></center>
<?php 
        } else {
            if ($autoApproval_ifJoin) {
                $status = 'Active';
                $message = getParam("t_Activation");
                $subject = getParam('t_Activation_subject');
                sendMail($p_arr['Email'], $subject, $message, $p_arr['ID']);
            } else {
                $status = 'Approval';
            }
            $update = db_res("UPDATE `Profiles` SET `Status` = '{$status}' WHERE `ID` = '{$ID}';");
            createUserDataFile($ID);
            reparseObjTags('profile', $ID);
            // Promotional membership
            if (getParam('enable_promotion_membership') == 'on') {
                $memership_days = getParam('promotion_membership_days');
                setMembership($p_arr['ID'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
            }
            echo _t("_EMAIL_CONF_SUCCEEDED", $site['title']);
            ?>
<br /><br />
<center><a href="member.php"><b><?php 
            echo _t("_Continue");
            ?>
 &gt;&gt;</b></a></center>
<?php 
            if ($newusernotify) {
                $message = "New user {$p_arr['NickName']} with email {$p_arr['Email']} has been confirmed,\nhis/her ID is {$p_arr['ID']}.\n--\n{$site['title']} mail delivery system\n<Auto-generated e-mail, please, do not reply>\n";
                $subject = "New user confirmed";
                sendMail($site['email_notify'], $subject, $message);
            }
        }
    } else {
        echo _t('_ALREADY_ACTIVATED');
    }
    echo "</td></table>";
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:95,代码来源:profile_activate.php

示例7: registerMember

 function registerMember()
 {
     $bEnAff = getParam('en_aff') == 'on';
     $oPC = new BxDolProfilesController();
     //convert to profile
     $aProfile = $this->oPF->getProfileFromValues($this->aValues[0]);
     //create it
     list($iMemID, $sStatus) = $oPC->createProfile($aProfile);
     if (!$iMemID) {
         return array(false, 'Fail');
     }
     if ($this->bCouple) {
         //convert
         $aProfile = $this->oPF->getProfileFromValues($this->aValues[1]);
         //create
         list($iMem1ID, $sStatus1) = $oPC->createProfile($aProfile, false, $iMemID);
         if (!$iMem1ID) {
             $oPC->deleteProfile($iMemID);
             return array(false, 'Fail');
         }
     }
     //send new user notification
     if (getParam('newusernotify') == 'on') {
         $oPC->sendNewUserNotify($iMemID);
     }
     // Affiliate and friend checking
     if ($bEnAff && $_COOKIE['idAff']) {
         $vRes = db_res("SELECT `ID` FROM `aff` WHERE `ID` = {$_COOKIE['idAff']} AND `Status` = 'active'");
         if (mysql_num_rows($vRes)) {
             $vRes = db_res("INSERT INTO `aff_members` (`idAff`,`idProfile`) VALUES ('{$_COOKIE['idAff']}', '{$iMemID}')");
         }
     }
     if ($bEnAff && $_COOKIE['idFriend']) {
         $iFriendID = getID($_COOKIE['idFriend']);
         if ($iFriendID) {
             $vRes = db_res("UPDATE `Profiles` SET `aff_num` = `aff_num` + 1 WHERE `ID` = '{$iFriendID}'");
             createUserDataFile($iFriendID);
         }
     }
     reparseObjTags('profile', $iMemID);
     return array($iMemID, $sStatus);
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:42,代码来源:join.php

示例8: deleteMedia

 function deleteMedia($iFile, $logged = array())
 {
     $iFile = (int) $iFile;
     $sqlQuery = "SELECT `{$this->aTableFields['medProfId']}`";
     $sqlQuery .= isset($this->aTableFields['medExt']) ? ", `{$this->aTableFields['medExt']}`" : "";
     $sqlQuery .= "FROM `{$this->sMainTable}` WHERE `{$this->aTableFields['medID']}`={$iFile}";
     $aFile = db_arr($sqlQuery);
     if (!$aFile) {
         return false;
     }
     if ($logged['admin']) {
     } elseif ($logged['member']) {
         $iMemberID = (int) $_COOKIE['memberID'];
         if ($aFile[$this->aTableFields['medProfId']] != $iMemberID) {
             return false;
         }
     } else {
         return false;
     }
     switch ($this->sType) {
         case 'photo':
             $aFName[] = $iFile . '.' . $aFile['medExt'];
             $aFName[] = $iFile . '_t.' . $aFile['medExt'];
             $aFName[] = $iFile . '_m.' . $aFile['medExt'];
             $sCmtsName = 'sharedPhoto';
             break;
         case 'music':
             $aFName[] = $iFile . '.mp3';
             $sCmtsName = 'sharedMusic';
             break;
         case 'video':
             $aFName[] = $iFile . '.flv';
             $aFName[] = $iFile . '.mpg';
             $aFName[] = $iFile . '.jpg';
             $aFName[] = $iFile . '_small.jpg';
             $sCmtsName = 'sharedVideo';
             break;
     }
     foreach ($aFName as $sVal) {
         $sFilePath = $this->sFilesPath . $sVal;
         @unlink($sFilePath);
     }
     db_res("DELETE FROM `{$this->sMainTable}` WHERE `{$this->aTableFields['medID']}`={$iFile}");
     reparseObjTags($this->sType, $iFile);
     $oVoting = new BxDolVoting('g' . $this->sType, 0, 0);
     $oVoting->deleteVotings($iFile);
     $oCmts = new BxDolCmts($sCmtsName, $iFile);
     $oCmts->onObjectDelete();
     header('Location:' . $_SERVER["HTTP_REFERER"]);
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:50,代码来源:BxDolSharedMedia.php

示例9: mp3_parseTags

function mp3_parseTags($iId)
{
    reparseObjTags('music', $iId);
}
开发者ID:noormcs,项目名称:studoro,代码行数:4,代码来源:customFunctions.inc.php

示例10: SDAddEvent


//.........这里部分代码省略.........
                 }
             } else {
                 $sBaseName = $sBaseName != "" ? $sBaseName : 'g_' . $sCurrentTime . '_1';
             }
         }
         $sExt = moveUploadedImage($_FILES, 'event_photo', $dir['tmp'] . $sBaseName, '', false);
         $sBaseName .= $sExt;
         $sPictureName = $sBaseName;
         $sThumbName = 'thumb_' . $sBaseName;
         $sIconName = 'icon_' . $sBaseName;
         // resize for thumbnail
         $vRes = imageResize($dir['tmp'] . $sBaseName, $dir['sdatingImage'] . $sThumbName, $this->iThumbSize, $this->iThumbSize);
         if ($vRes != IMAGE_ERROR_SUCCESS) {
             return SDATING_ERROR_PHOTO_PROCESS;
         }
         $vRes = imageResize($dir['tmp'] . $sBaseName, $dir['sdatingImage'] . $sPictureName, $this->iImgSize, $this->iImgSize);
         if ($vRes != IMAGE_ERROR_SUCCESS) {
             return SDATING_ERROR_PHOTO_PROCESS;
         }
         $vRes = imageResize($dir['tmp'] . $sBaseName, $dir['sdatingImage'] . $sIconName, $this->iIconSize, $this->iIconSize);
         if ($vRes != IMAGE_ERROR_SUCCESS) {
             return SDATING_ERROR_PHOTO_PROCESS;
         }
         unlink($dir['tmp'] . $sBaseName);
         chmod($dir['sdatingImage'] . $sPictureName, 0644);
         chmod($dir['sdatingImage'] . $sThumbName, 0644);
         chmod($dir['sdatingImage'] . $sIconName, 0644);
         $sEventPhotoFilename = process_db_input($sPictureName);
     } else {
         $sEventPhotoFilename = '';
     }
     $sPictureSQL = '';
     if ($iEventID > 0 && $sEventPhotoFilename != '') {
         $sPictureSQL = "`PhotoFilename` = '{$sEventPhotoFilename}',";
     }
     // event date
     $sEventStart = strtotime($_REQUEST['event_start']);
     if ($sEventStart == -1) {
         return SDATING_ERROR_WRONG_DATE_FORMAT;
     }
     if ($this->bAdminMode) {
         $sEventEnd = strtotime($_POST['event_end']);
         //if ( $sEventEnd == -1 )
         //	return SDATING_ERROR_WRONG_DATE_FORMAT;
         $sEventSaleStart = strtotime($_POST['event_sale_start']);
         //if ( $sEventSaleStart == -1 )
         //	return SDATING_ERROR_WRONG_DATE_FORMAT;
         $sEventSaleEnd = strtotime($_POST['event_sale_end']);
         //if ( $sEventSaleEnd == -1 )
         //	return SDATING_ERROR_WRONG_DATE_FORMAT;
         //if ( $sEventEnd < $sEventStart || $sEventSaleEnd < $sEventSaleStart || $sEventStart < $sEventSaleStart )
         //	return SDATING_ERROR_WRONG_DATE_FORMAT;
         $sEventEndVal = "FROM_UNIXTIME( {$sEventEnd} )";
         $sEventSaleStartVal = "FROM_UNIXTIME( {$sEventSaleStart} )";
         $sEventSaleEndVal = "FROM_UNIXTIME( {$sEventSaleEnd} )";
     } else {
         $sEventEndVal = 'NOW()';
         $sEventSaleStartVal = 'NOW()';
         $sEventSaleEndVal = 'NOW()';
     }
     // event responsible
     $sEventRespId = $this->bAdminMode ? 0 : process_db_input($aMemberData['ID'], 0, 1);
     $sEventRespName = $this->bAdminMode ? _t('Admin') : process_db_input($aMemberData['NickName'], 0, 1);
     $sEventRespEmail = $this->bAdminMode ? $site['email'] : process_db_input($aMemberData['Email'], 0, 1);
     $sEventRespPhone = $this->bAdminMode ? '666' : process_db_input($aMemberData['Phone'], 0, 1);
     $iEventAgeLowerFilter = (int) getParam('search_start_age');
     $iEventAgeUpperFilter = (int) getParam('search_end_age');
     $sEventMembershipFilter = "\\'all\\'";
     $iEventCountF = (int) $_POST['event_count_female'];
     $iEventCountM = (int) $_POST['event_count_male'];
     $dEventPriceF = '0.00';
     $dEventPriceM = '0.00';
     $dEventPriceC = '0.00';
     // choose options
     $iEventChoosePeriod = 5;
     // allow to view participants
     $iEventAllowView = '1';
     if ($iEventID == -1) {
         $sNewUri = uriGenerate($sEventTitle, 'SDatingEvents', 'EntryUri', 100);
         //Commented elements
         /*`EventEnd` = FROM_UNIXTIME( {$sEventEnd} ),*/
         /*`TicketSaleStart` = FROM_UNIXTIME( {$sEventSaleStart} ),*/
         /*`TicketSaleEnd` = FROM_UNIXTIME( {$sEventSaleEnd} ),*/
         $vRes = db_res("INSERT INTO `SDatingEvents` SET\r\n\t\t\t\t\t\t`Title` = '{$sEventTitle}',\r\n\t\t\t\t\t\t`EntryUri` = '{$sNewUri}',\r\n\t\t\t\t\t\t`Description` = '{$sEventDesc}',\r\n\t\t\t\t\t\t`Status` = 'Active',\r\n\t\t\t\t\t\t`StatusMessage` = '{$sEventStatusMessage}',\r\n\t\t\t\t\t\t`Country` = '{$sEventCountry}',\r\n\t\t\t\t\t\t`City` = '{$sEventCity}',\r\n\t\t\t\t\t\t`Place` = '{$EventPlace}',\r\n\t\t\t\t\t\t`PhotoFilename` = '{$sEventPhotoFilename}',\r\n\t\t\t\t\t\t`EventStart` = FROM_UNIXTIME( {$sEventStart} ),\r\n\t\t\t\t\t\t`EventEnd` = {$sEventEndVal},\r\n\t\t\t\t\t\t`TicketSaleStart` = {$sEventSaleStartVal},\r\n\t\t\t\t\t\t`TicketSaleEnd` = {$sEventSaleEndVal},\r\n\t\t\t\t\t\t`ResponsibleID` = '{$sEventRespId}',\r\n\t\t\t\t\t\t`ResponsibleName` = '{$sEventRespName}',\r\n\t\t\t\t\t\t`ResponsibleEmail` = '{$sEventRespEmail}',\r\n\t\t\t\t\t\t`ResponsiblePhone` = '{$sEventRespPhone}',\r\n\t\t\t\t\t\t`EventSexFilter` = 'female,male',\r\n\t\t\t\t\t\t`EventAgeLowerFilter` = {$iEventAgeLowerFilter},\r\n\t\t\t\t\t\t`EventAgeUpperFilter` = {$iEventAgeUpperFilter},\r\n\t\t\t\t\t\t`EventMembershipFilter` = '{$sEventMembershipFilter}',\r\n\t\t\t\t\t\t`TicketCountFemale` = {$iEventCountF},\r\n\t\t\t\t\t\t`TicketCountMale` = {$iEventCountM},\r\n\t\t\t\t\t\t`TicketPriceFemale` = {$dEventPriceF},\r\n\t\t\t\t\t\t`TicketPriceMale` = {$dEventPriceM},\r\n\t\t\t\t\t\t`ChoosePeriod` = {$iEventChoosePeriod},\r\n\t\t\t\t\t\t`AllowViewParticipants` = {$iEventAllowView},\r\n\t\t\t\t\t\t`Tags` = '{$sTags}'\r\n\t\t\t\t\t\t");
         $iLastID = mysql_insert_id();
         if ($iLastID > 0) {
             $this->iLastInsertedID = $iLastID;
             reparseObjTags('event', $iLastID);
         }
     } else {
         //$sNewUri = uriGenerate($sEventTitle, 'SDatingEvents', 'EntryUri', 100);
         //Commented elements
         /*`EventEnd` = FROM_UNIXTIME( {$sEventEnd} ),*/
         /*`TicketSaleStart` = FROM_UNIXTIME( {$sEventSaleStart} ),*/
         /*`TicketSaleEnd` = FROM_UNIXTIME( {$sEventSaleEnd} ),*/
         $vRes = db_res("UPDATE `SDatingEvents` SET\r\n\t\t\t\t\t\t`Title` = '{$sEventTitle}',\r\n\t\t\t\t\t\t`Description` = '{$sEventDesc}',\r\n\t\t\t\t\t\t`Status` = 'Active',\r\n\t\t\t\t\t\t`StatusMessage` = '{$sEventStatusMessage}',\r\n\t\t\t\t\t\t`Country` = '{$sEventCountry}',\r\n\t\t\t\t\t\t`City` = '{$sEventCity}',\r\n\t\t\t\t\t\t`Place` = '{$EventPlace}',\r\n\t\t\t\t\t\t{$sPictureSQL}\r\n\t\t\t\t\t\t`EventStart` = FROM_UNIXTIME( {$sEventStart} ),\r\n\t\t\t\t\t\t`EventEnd` = {$sEventEndVal},\r\n\t\t\t\t\t\t`TicketSaleStart` = {$sEventSaleStartVal},\r\n\t\t\t\t\t\t`TicketSaleEnd` = {$sEventSaleEndVal},\r\n\t\t\t\t\t\t`ResponsibleID` = '{$sEventRespId}',\r\n\t\t\t\t\t\t`ResponsibleName` = '{$sEventRespName}',\r\n\t\t\t\t\t\t`ResponsibleEmail` = '{$sEventRespEmail}',\r\n\t\t\t\t\t\t`ResponsiblePhone` = '{$sEventRespPhone}',\r\n\t\t\t\t\t\t`EventSexFilter` = 'female,male',\r\n\t\t\t\t\t\t`EventAgeLowerFilter` = {$iEventAgeLowerFilter},\r\n\t\t\t\t\t\t`EventAgeUpperFilter` = {$iEventAgeUpperFilter},\r\n\t\t\t\t\t\t`EventMembershipFilter` = '{$sEventMembershipFilter}',\r\n\t\t\t\t\t\t`TicketCountFemale` = {$iEventCountF},\r\n\t\t\t\t\t\t`TicketCountMale` = {$iEventCountM},\r\n\t\t\t\t\t\t`TicketPriceFemale` = {$dEventPriceF},\r\n\t\t\t\t\t\t`TicketPriceMale` = {$dEventPriceM},\r\n\t\t\t\t\t\t`ChoosePeriod` = {$iEventChoosePeriod},\r\n\t\t\t\t\t\t`AllowViewParticipants` = {$iEventAllowView},\r\n\t\t\t\t\t\t`Tags` = '{$sTags}'\r\n\t\t\t\t\t\tWHERE `ID` = {$iEventID}\r\n\t\t\t\t\t\t");
         reparseObjTags('event', $iEventID);
     }
     return SDATING_ERROR_SUCCESS;
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:BxDolEvents.php

示例11: deleteMedia

function deleteMedia($iFile, $sType, $sExt = '')
{
    global $dir;
    global $logged;
    $sType = $sType == 'Video' ? 'Movie' : $sType;
    // delete voting
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php';
    if ($logged['admin']) {
    } elseif ($logged['member']) {
        $iMemberID = (int) $_COOKIE['memberID'];
        if ($sType == 'Photo') {
            $sTableName = "`share{$sType}Files`";
            $sQuery = "SELECT * FROM {$sTableName} WHERE `medID`='{$iFile}'";
        } else {
            $sTableName = "`Ray{$sType}Files`";
            $sQuery = "SELECT `ID` as `medID`,\r\n\t  \t\t\t\t\t  `Title` as `medTitle`,\r\n\t  \t\t\t\t\t  `Description` as `medDesc`,\r\n\t  \t\t\t\t\t  `Date` as `medDate`,\r\n\t  \t\t\t\t\t  `Owner` as `medProfId`\r\n\t  \t\t\t   FROM {$sTableName} \r\n\t  \t\t\t   WHERE `ID`='{$iFile}'";
        }
        $aFile = db_arr($sQuery);
        if (!$aFile) {
            return false;
        }
        if ($aFile['medProfId'] != $iMemberID) {
            return false;
        }
    } else {
        return false;
    }
    $aFName = array();
    switch ($sType) {
        case 'Music':
            $sTableName = "`Ray{$sType}Files`";
            $sModPath = 'ray/modules/music/files/';
            $aFName[] = $iFile . '.mp3';
            $oVoting = new BxDolVoting('gmusic', 0, 0);
            $sTagsType = 'music';
            break;
        case 'Photo':
            $sTableName = "`share{$sType}Files`";
            $sModPath = 'media/images/sharingImages/';
            $aFName[] = $iFile . '.' . $sExt;
            $aFName[] = $iFile . '_t.' . $sExt;
            $aFName[] = $iFile . '_m.' . $sExt;
            $oVoting = new BxDolVoting('gphoto', 0, 0);
            $sTagsType = 'photo';
            break;
        case 'Movie':
            $sTableName = "`Ray{$sType}Files`";
            $sModPath = 'ray/modules/movie/files/';
            $aFName[] = $iFile . '.jpg';
            $aFName[] = $iFile . '_small.jpg';
            $aFName[] = $iFile . '.flv';
            $aFName[] = $iFile . '.mpg';
            $oVoting = new BxDolVoting('gvideo', 0, 0);
            $sTagsType = 'video';
            break;
    }
    foreach ($aFName as $iK => $sVal) {
        $sFilePath = BX_DIRECTORY_PATH_ROOT . $sModPath . $sVal;
        @unlink($sFilePath);
    }
    $sCond = $sType == 'Photo' ? " `medID`='{$iFile}'" : "`ID`='{$iFile}'";
    db_res("DELETE FROM {$sTableName} WHERE {$sCond}");
    reparseObjTags($sTagsType, $iFile);
    $oVoting->deleteVotings($iFile);
    header('Location:' . $_SERVER["HTTP_REFERER"]);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:66,代码来源:sharing.inc.php

示例12: createUserDataFile

        createUserDataFile((int) $iId);
        reparseObjTags('profile', (int) $iId);
        $aProfile = getProfileInfo($iId);
        $aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId);
        sendMail($aProfile['Email'], $aMail['subject'], $aMail['body'], $iId, array(), 'html', false, true);
        $oAlert = new BxDolAlerts('profile', 'change_status', (int) $iId, 0, array('status' => 'Active'));
        $oAlert->alert();
    }
    echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
    exit;
} else {
    if (isset($_POST['adm-mp-deactivate']) && (bool) $_POST['members']) {
        $GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status`='Approval' WHERE `ID` IN ('" . implode("','", $_POST['members']) . "')");
        foreach ($_POST['members'] as $iId) {
            createUserDataFile((int) $iId);
            reparseObjTags('profile', (int) $iId);
            $oAlert = new BxDolAlerts('profile', 'change_status', (int) $iId, 0, array('status' => 'Approval'));
            $oAlert->alert();
        }
        echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
        exit;
    } else {
        if (isset($_POST['adm-mp-ban']) && (bool) $_POST['members']) {
            foreach ($_POST['members'] as $iId) {
                $GLOBALS['MySQL']->query("REPLACE INTO `sys_admin_ban_list` SET `ProfID`='" . $iId . "', `Time`='0',  `DateTime`=NOW()");
            }
            echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
            exit;
        } else {
            if (isset($_POST['adm-mp-unban']) && (bool) $_POST['members']) {
                $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $_POST['members']) . "')");
开发者ID:Arvindvi,项目名称:dolphin,代码行数:31,代码来源:profiles.php

示例13: uploadFile

function uploadFile($sFile, $sDesc, $sTags, $iUser)
{
    global $dir;
    if ($_FILES['uploadFile']['error'] != 0) {
        $sCode = '<div class="uploadStatus">' . _t("_File upload error") . '</div>';
    } else {
        $aFileInfo = getimagesize($_FILES['uploadFile']['tmp_name']);
        if (!$aFileInfo) {
            $sCode = '<div class="uploadStatus">' . _t("_You uploaded not image file") . '</div>';
        } else {
            $ext = false;
            switch ($aFileInfo['mime']) {
                case 'image/jpeg':
                    $ext = 'jpg';
                    break;
                case 'image/gif':
                    $ext = 'gif';
                    break;
                case 'image/png':
                    $ext = 'png';
                    break;
                default:
                    $ext = false;
            }
            if (!$ext) {
                $sCode = '<div class="uploadStatus">' . _t("_You uploaded not JPEG, GIF or PNG file") . '</div>';
            } else {
                $sCode = '<div class="uploadStatus">' . _t("_Upload successful") . '</div>';
                $sActive = getParam("enable_shPhotoActivation") == 'on' ? 'true' : 'false';
                $sPhotoUri = uriGenerate($sFile, 'sharePhotoFiles', 'medUri');
                $sQuery = "INSERT INTO `sharePhotoFiles` (`medProfId`,`medTitle`,`medUri`,`medExt`,`medDesc`,`medTags`,`medDate`,`Approved`) VALUES('{$iUser}','{$sFile}','{$sPhotoUri}','{$ext}','{$sDesc}','{$sTags}'," . time() . ",'{$sActive}')";
                db_res($sQuery);
                $iNew = mysql_insert_id();
                reparseObjTags('photo', $iNew);
                $sNewFileName = $dir['sharingImages'] . $iNew . '.' . $ext;
                $sNewMainName = $dir['sharingImages'] . $iNew . '_m.' . $ext;
                $sNewThumbName = $dir['sharingImages'] . $iNew . '_t.' . $ext;
                $iUpload = (int) preg_replace('/\\D/', '', ini_get('upload_max_filesize'));
                $iPost = (int) preg_replace('/\\D/', '', ini_get('post_max_size'));
                $iMin = $iUpload > $iPost ? $iPost : $iUpload;
                if ($_FILES['uploadFile']['size'] && $_FILES['uploadFile']['size'] > $iMin * 1024 * 1024) {
                    $sCode = '<div class="uploadStatus">' . _t("_SIZE_TOO_BIG") . '</div>';
                } else {
                    if (!move_uploaded_file($_FILES['uploadFile']['tmp_name'], $sNewFileName)) {
                        $sCode = '<div class="uploadStatus">' . _t("_Couldn\\'t move file") . '</div>';
                    } else {
                        chmod($sNewFileName, 0644);
                        $iWidth = (int) getParam("max_photo_width");
                        $iHeight = (int) getParam("max_photo_height");
                        $iThumbW = (int) getParam("max_thumb_width");
                        $iThumbH = (int) getParam("max_thumb_height");
                        if (imageResize($sNewFileName, $sNewMainName, $iWidth, $iHeight) != IMAGE_ERROR_SUCCESS) {
                            $sCode = '<div class="uploadStatus">' . _t("_Upload failed") . '</div>';
                        } else {
                            imageResize($sNewMainName, $sNewThumbName, $iThumbW, $iThumbH);
                            $bPermalink = getParam('permalinks_gallery_photos') == 'on' ? true : false;
                            $sFileLink = getFileUrl($iNew, $sPhotoUri, 'photo', $bPermalink);
                            header("Location:" . $sFileLink);
                            exit;
                        }
                    }
                }
                $sqlDelete = "DELETE FROM `sharePhotoFiles` WHERE `medID`='{$iNew}'";
                db_res($sqlDelete);
            }
        }
    }
    return $sCode;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:69,代码来源:uploadSharePhoto.php

示例14: process

 function process()
 {
     if (!$this->iProfileID) {
         return _t('_Profile not specified');
     }
     if (!$this->iArea) {
         return _t('_You cannot edit this profile');
     }
     /* @var $this->oPC BxDolProfilesController */
     $this->oPC = new BxDolProfilesController();
     //get profile info array
     $this->aProfiles[0] = $this->oPC->getProfileInfo($this->iProfileID);
     if (!$this->aProfiles[0]) {
         return _t('_Profile not found');
     }
     if ($this->aProfiles[0]['Couple']) {
         // load couple profile
         $this->aProfiles[1] = $this->oPC->getProfileInfo($this->aProfiles[0]['Couple']);
         if (!$this->aProfiles[1]) {
             return _t('_Couple profile not found');
         }
         $this->bCouple = true;
         //couple enabled
     }
     /* @var $this->oPF BxDolProfileFields */
     $this->oPF = new BxDolProfileFields($this->iArea);
     if (!$this->oPF->aArea) {
         return 'Profile Fields cache not loaded. Cannot continue.';
     }
     $this->aCoupleMutualFields = $this->oPF->getCoupleMutualFields();
     //collect blocks
     $this->aBlocks = $this->oPF->aArea;
     //collect items
     $this->aItems = array();
     foreach ($this->aBlocks as $aBlock) {
         foreach ($aBlock['Items'] as $iItemID => $aItem) {
             $this->aItems[$iItemID] = $aItem;
         }
     }
     $this->aValues[0] = $this->oPF->getValuesFromProfile($this->aProfiles[0]);
     // set default values
     if ($this->bCouple) {
         $this->aValues[1] = $this->oPF->getValuesFromProfile($this->aProfiles[1]);
     }
     // set default values
     $this->aOldValues = $this->aValues;
     $sStatusText = '';
     if (isset($_POST['do_submit'])) {
         $this->oPF->processPostValues($this->bCouple, $this->aValues, $this->aErrors, 0, $this->iProfileID);
         if (empty($this->aErrors[0]) and empty($this->aErrors[1]) and !$this->bAjaxMode) {
             // do not save in ajax mode
             $this->saveProfile();
             $sStatusText = '_Save profile successful';
             reparseObjTags('profile', $this->iProfileID);
         }
     }
     if ($this->bAjaxMode) {
         //print_r( $_POST );
         $this->showErrorsJson();
         exit;
     } else {
         ob_start();
         $this->showEditForm($sStatusText);
         return ob_get_clean();
     }
 }
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:66,代码来源:pedit.php

示例15: ApproveSelectedAdv

function ApproveSelectedAdv()
{
    $sSuccUpd = _t("_SUCC_UPD_ADV");
    $sFailUpd = _t("_FAIL_UPD_ADV");
    if (isset($_REQUEST['Check']) && is_array($_REQUEST['Check'])) {
        foreach ($_REQUEST['Check'] as $iKey => $iVal) {
            $query = "UPDATE `ClassifiedsAdvertisements` SET `Status` = 'active' WHERE `ID` = {$iVal} LIMIT 1";
            $sqlRes = db_res($query);
            reparseObjTags('ad', $iVal);
        }
    }
    $ret = mysql_affected_rows() != 0 ? _t($sSuccUpd) : _t($sFailUpd);
    return MsgBox($ret);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:14,代码来源:manage_classifieds.php


注:本文中的reparseObjTags函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。