本文整理汇总了PHP中Instagram::sendInstagramm方法的典型用法代码示例。如果您正苦于以下问题:PHP Instagram::sendInstagramm方法的具体用法?PHP Instagram::sendInstagramm怎么用?PHP Instagram::sendInstagramm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instagram
的用法示例。
在下文中一共展示了Instagram::sendInstagramm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdd
public function actionAdd($url)
{
foreach ($this->parseUrl($url) as $k => $v) {
${$k} = $v;
}
$model = new $obj_class();
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if (isset($_POST['Text'])) {
$text = new Text();
$text->attributes = $_POST['Text'];
if ($text->save()) {
$this->redirect($rubric->getLink());
}
} else {
if ($_POST[$obj_class]) {
if ($_FILES['file']) {
foreach ($_FILES['file']['name'] as $k => $v) {
if ($v) {
$file[$k] = CUploadedFile::getInstanceByName('file[' . $k . ']');
if (in_array(strtolower($file[$k]->getExtensionName()), array('jpg', 'gif', 'png', 'jpeg'))) {
$model->{$k} = $k . '.' . $file[$k]->getExtensionName();
} else {
$model->{$k} = CUploadedFile::getInstanceByName('file[' . $k . ']');
}
}
}
}
$model->attributes = $_POST[$obj_class];
if ($model->save()) {
if ($file) {
$folder = dirname(Yii::app()->request->scriptFile);
$folder .= '/userdata/' . $ctype . '/' . $ctype . '_' . $model->id . '/';
foreach ($file as $k => $v) {
if (in_array(strtolower($file[$k]->getExtensionName()), array('jpg', 'gif', 'png', 'jpeg'))) {
UploadImages::upload($file[$k]->getTempName(), $model->{$k}, $folder, $ctype, $k);
} else {
$model->{$k}->saveAs($folder . $model->{$k}->getName());
}
}
if (get_class($model) == "Sales") {
$instaPost = Instagram::sendInstagramm($_SERVER['DOCUMENT_ROOT'] . "/userdata/sales/sales_" . $model->id . "/insta/" . $model->image, $model->name . "\n" . $model->announce . "\n" . " #gdeskidki #sale #гдескидки #скидки #" . str_replace(' ', '', $model->brand->name));
}
}
if (get_class($model) == 'Sales') {
$VKWallPost = VK::wallPost($model->name, $model->announce, $this->getLink($model, 1), $this->getImageUrl($model, 'orig'));
}
$this->redirect($rubric->getLink() . '?' . Yii::app()->request->queryString);
} else {
exit(var_dump($model->getErrors()));
}
}
}
$data = array('model' => $model, 'title' => $rubric->name, 'rubric' => $rubric);
$this->render('/_form/create', $data);
}