mirror of
https://github.com/openvk/openvk
synced 2025-07-07 00:09:48 +03:00
Add the ability to specify the website of users and groups
This commit is contained in:
parent
610b2bda6d
commit
28e24fff93
8 changed files with 45 additions and 1 deletions
|
@ -170,6 +170,11 @@ final class GroupPresenter extends OpenVKPresenter
|
|||
$club->setShortcode(empty($this->postParam("shortcode")) ? NULL : $this->postParam("shortcode"));
|
||||
$club->setWall(empty($this->postParam("wall")) ? 0 : 1);
|
||||
$club->setAdministrators_List_Display(empty($this->postParam("administrators_list_display")) ? 0 : $this->postParam("administrators_list_display"));
|
||||
if(strpos($this->postParam("website") ?? "", "https://") === 0 || strpos($this->postParam("website") ?? "", "http://") === 0) {
|
||||
$club->setWebsite(empty($this->postParam("website")) ? NULL : $this->postParam("website"));
|
||||
} else {
|
||||
$club->setWebsite(empty($this->postParam("website")) ? NULL : "http://" . $this->postParam("website"));
|
||||
}
|
||||
|
||||
if($_FILES["ava"]["error"] === UPLOAD_ERR_OK) {
|
||||
$photo = new Photo;
|
||||
|
|
|
@ -125,6 +125,11 @@ final class UserPresenter extends OpenVKPresenter
|
|||
$user->setTelegram(empty($this->postParam("telegram")) ? NULL : $this->postParam("telegram"));
|
||||
$user->setCity(empty($this->postParam("city")) ? NULL : $this->postParam("city"));
|
||||
$user->setAddress(empty($this->postParam("address")) ? NULL : $this->postParam("address"));
|
||||
if(strpos($this->postParam("website") ?? "", "https://") === 0 || strpos($this->postParam("website") ?? "", "http://") === 0) {
|
||||
$user->setWebsite(empty($this->postParam("website")) ? NULL : $this->postParam("website"));
|
||||
} else {
|
||||
$user->setWebsite(empty($this->postParam("website")) ? NULL : "http://" . $this->postParam("website"));
|
||||
}
|
||||
} elseif($_GET['act'] === "interests") {
|
||||
$user->setInterests(empty($this->postParam("interests")) ? NULL : ovk_proc_strtr($this->postParam("interests"), 300));
|
||||
$user->setFav_Music(empty($this->postParam("fav_music")) ? NULL : ovk_proc_strtr($this->postParam("fav_music"), 300));
|
||||
|
|
|
@ -53,6 +53,14 @@
|
|||
<input type="text" name="shortcode" value="{$club->getShortcode()}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_website}: </span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="website" value="{$club->getWebsite()}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_avatar}: </span>
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
<td><span class="nobold">{_"description"}:</span></td>
|
||||
<td>{$club->getDescription()}</td>
|
||||
</tr>
|
||||
<tr n:if="!is_null($club->getWebsite())">
|
||||
<td><span class="nobold">{_"website"}: </span></td>
|
||||
<td>
|
||||
<a href="{$club->getWebsite()}" rel="ugc" target="_blank">
|
||||
{$club->getWebsite()}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -173,6 +173,14 @@
|
|||
<input type="text" name="telegram" value="{$user->getTelegram()}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_"personal_website"}: </span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="website" value="{$user->getWebsite()}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120" valign="top">
|
||||
<span class="nobold">{_"city"}: </span>
|
||||
|
|
|
@ -424,6 +424,14 @@
|
|||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr n:if="!is_null($user->getWebsite())">
|
||||
<td class="label"><span class="nobold">{_"personal_website"}: </span></td>
|
||||
<td>
|
||||
<a href="{$user->getWebsite()}" rel="ugc" target="_blank">
|
||||
{$user->getWebsite()}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<!--/sse-->
|
||||
<tr n:if="!is_null($user->getCity())">
|
||||
<td class="label"><span class="nobold">{_"city"}:</span></td>
|
||||
|
|
2
install/sqls/00008-website-contact.sql
Normal file
2
install/sqls/00008-website-contact.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE profiles ADD COLUMN website VARCHAR(128) AFTER telegram;
|
||||
ALTER TABLE groups ADD COLUMN website VARCHAR(128);
|
2
locales
2
locales
|
@ -1 +1 @@
|
|||
Subproject commit ce4ede6f8c6cb42f2421969fab23da933c81b52b
|
||||
Subproject commit 6b3e57648a5fdbfd320f0ad829849dfa76f62d68
|
Loading…
Reference in a new issue