本文整理汇总了PHP中Photo::creerPhoto方法的典型用法代码示例。如果您正苦于以下问题:PHP Photo::creerPhoto方法的具体用法?PHP Photo::creerPhoto怎么用?PHP Photo::creerPhoto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photo
的用法示例。
在下文中一共展示了Photo::creerPhoto方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajouterPara
function ajouterPara()
{
$newParag = new Paragraphe();
$newParag->titrePara = $_POST['textTitrePara'];
$newParag->contenuPara = $_POST['textCont'];
$numpara = $newParag->creerParagraphe();
$laPage = new Page();
$laPage->numpage = $_GET['numpage'];
$laPage->id_m = $_GET['id'];
$laPage->numpara = $numpara;
$laPage->ordre = $_POST['selectOrdre'];
$laPage->colonne = $_POST['selectType'];
$laPage->liste = $_POST['radioListe'];
$laPage->typeTitre = $_POST['radioTypeTitre'];
$laPage->ajouterParagraphe();
// On l'ajoute à la page
for ($i = 1; $i <= $_POST['nbLiens']; $i++) {
// On traite l'ajout de liens
$valUrl = "textUrlLien" . $i . "_";
$valPage = "selectPage" . $i . "_";
if (${$valUrl} || ${$valPage}) {
$valLib = "textLibLien" . $i . "_";
$valTexte = "textTexteLien" . $i . "_";
$valOrdre = "selectOrdreLien" . $i . "_";
$valFen = "radioFen" . $i . "_";
$newLien = new Lien();
$newLien->numpara = $numpara;
$newLien->libLien = ${$valLib};
$newLien->texteLien = ${$valTexte};
if (${$valPage}) {
$pageLien = new Page();
$pageLien->numpage = ${$valPage};
$pageLien->infosPage();
$newLien->numpage = ${$valPage};
$newLien->urlLien = $pageLien->aliasPage;
} else {
$newLien->urlLien = ${$valUrl};
}
$newLien->fenLien = ${$valFen};
$newLien->ordreLien = ${$valOrdre};
$newLien->creerLien();
}
//fin if ($$valUrl)
}
//fin du for
for ($i = 1; $i <= $nbPhotos; $i++) {
// On traite l'association de photos
$valSelect = "selectPhoto" . $i . "_";
$valFile = "filePhoto" . $i . "_";
if (${$valSelect} || isset($_FILES[$valFile]['tmp_name']) && $_FILES[$valFile]['tmp_name'] != "") {
$valLeg = "textLegPh" . $i . "_";
$valOrdre = "selectOrdrePhoto" . $i . "_";
$valTaille = "radioTaille" . $i . "_";
if (${$valSelect}) {
// on associe une photo existante
$newParag->numphoto = ${$valSelect};
$newParag->ordrePhoto = ${$valOrdre};
$newParag->legPhoto = ${$valLeg};
$newParag->associerPhoto();
} else {
if (isset($_FILES[$valFile]['tmp_name']) && $_FILES[$valFile]['tmp_name'] != "") {
// on cr�e une photo
$newPhoto = new Photo();
$newPhoto->nomPhoto = normaliza(basename($_FILES[$valFile]['name']));
$newPhoto->tmp_name = $_FILES[$valFile]['tmp_name'];
$newPhoto->taille = ${$valTaille};
$numphoto = $newPhoto->creerPhoto();
// On associe ensuite la photo au paragraphe
$newParag->numphoto = $numphoto;
$newParag->ordrePhoto = ${$valOrdre};
$newParag->legPhoto = ${$valLeg};
$newParag->associerPhoto();
}
}
}
//fin if ($$valSelect || $$valFile)
}
//fin du for
for ($i = 1; $i <= $nbVideos; $i++) {
// On traite l'association de vidéos
$valSelect = "selectVideo" . $i . "_";
$valFile = "fileVideo" . $i . "_";
if (${$valSelect} || isset($_FILES[$valFile]['tmp_name']) && $_FILES[$valFile]['tmp_name'] != "") {
$valLeg = "textLegVi" . $i . "_";
$valOrdre = "selectOrdreVideo" . $i . "_";
if (${$valSelect}) {
// on associe une vidéo existante
$newParag->numvideo = ${$valSelect};
$newParag->ordreVideo = ${$valOrdre};
$newParag->legVideo = ${$valLeg};
$newParag->associerVideo();
} else {
if (isset($_FILES[$valFile]['tmp_name']) && $_FILES[$valFile]['tmp_name'] != "") {
// on cree une video
$newVideo = new Video();
$newVideo->nomVideo = normaliza(basename($_FILES[$valFile]['name']));
$newVideo->tmp_name = $_FILES[$valFile]['tmp_name'];
$numvideo = $newVideo->creerVideo();
// On associe ensuite la vidéo au paragraphe
$newParag->numvideo = $numvideo;
//.........这里部分代码省略.........
示例2: Paragraphe
if ($numphoto) {
// modification de photo
$sauv_numphoto = $numphoto;
$modifParag = new Paragraphe();
$modifParag->numparaphoto = $numparaphoto;
if ($selectPhoto || isset($_FILES["filePhoto"]['tmp_name']) && $_FILES["filePhoto"]['tmp_name'] != "") {
if (isset($_FILES["filePhoto"]['tmp_name']) && $_FILES["filePhoto"]['tmp_name'] != "") {
// on crée une photo
$newPhoto = new Photo();
$nom_photo = normaliza(basename($_FILES["filePhoto"]['name']));
$newPhoto->nomPhoto = $nom_photo;
$newPhoto->tmp_name = $_FILES["filePhoto"]['tmp_name'];
$newPhoto->taille = $radioTaille;
$newPhoto->modif = 1;
// utile pour changer la valeur $chem="../"
$numphoto = $newPhoto->creerPhoto();
// On modifie ensuite la photo du paragraphe
$modifParag->numphoto = $numphoto;
$modifParag->ordrePhoto = $selectOrdrePhoto;
$modifParag->legPhoto = $textLegPh;
$modifParag->modifierPhoto();
} else {
if ($selectPhoto) {
// on associe une photo existante
$modifParag->numphoto = $selectPhoto;
$newPhoto = new Photo();
$newPhoto->numphoto = $selectPhoto;
$newPhoto->infosPhoto();
$nom_photo = $newPhoto->nomPhoto;
$modifParag->ordrePhoto = $selectOrdrePhoto;
$modifParag->legPhoto = $textLegPh;