Skip to content

Commit

Permalink
4.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PhocaCz committed Oct 1, 2022
1 parent 9069514 commit 2f46b8e
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Phoca Guestbook is Joomla! CMS component. It displays guestbook form with Captch

## Version (Joomla! 4.x)

4.0.1
4.0.2



Expand Down
5 changes: 5 additions & 0 deletions admin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@
<option value="1">COM_PHOCAGUESTBOOK_YES</option>
</field>

<field name="store_ip" type="radio" class="btn-group" default="1" label="COM_PHOCAGUESTBOOK_FIELD_STORE_IP_ADDRESS_LABEL" description="COM_PHOCAGUESTBOOK_FIELD_STORE_IP_ADDRESS_DESC">
<option value="0">COM_PHOCAGUESTBOOK_NO</option>
<option value="1">COM_PHOCAGUESTBOOK_YES</option>
</field>

</fieldset>

<fieldset name="post"
Expand Down
4 changes: 4 additions & 0 deletions admin/language/en-GB/en-GB.com_phocaguestbook.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
; @test utf-8 ä, ö, ü
;

;[4.0.2]
COM_PHOCAGUESTBOOK_FIELD_STORE_IP_ADDRESS_LABEL="Store IP Address"
COM_PHOCAGUESTBOOK_FIELD_STORE_IP_ADDRESS_DESC="Store or not to store IP Address. If yes, IP address can be stored in logs, posts, etc. If you do not want to store the IP address anywhere, choose no."

;[4.0.0 Beta]
COM_PHOCAGUESTBOOK_LICENSE="License"
COM_PHOCAGUESTBOOK_TIME="Time"
Expand Down
6 changes: 3 additions & 3 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<description><![CDATA[ Phoca Guestbook is Joomla! CMS component. It displays guestbook form with Captcha (8 types of Captcha) and many other different internal or external spam protection methods. ]]></description>
<element>com_phocaguestbook</element>
<type>component</type>
<version>4.0.1</version>
<infourl title="Phoca Guestbook 4.0.1">http://www.phoca.cz/version/index.php?phocaguestbook=4.0.1</infourl>
<version>4.0.2</version>
<infourl title="Phoca Guestbook 4.0.2">http://www.phoca.cz/version/index.php?phocaguestbook=4.0.2</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaGuestbook/releases/download/4.0.1/com_phocaguestbook_v4.0.1.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaGuestbook/releases/download/4.0.2/com_phocaguestbook_v4.0.2.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
12 changes: 12 additions & 0 deletions media/css/phocaguestbook.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,15 @@
.pgb-btn-danger {
margin: auto 0.3em;
}


@media (max-width:768px) {

#phocaguestbook .form-horizontal .controls {
margin-left: 0;
}
#phocaguestbook .form-horizontal .control-label {
float: none;
display: block;
}
}
Binary file modified phocaguestbook-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion phocaguestbook-release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions phocaguestbook.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="component" method="upgrade" version="4.0">
<name>com_phocaguestbook</name>
<author>Jan Pavelka (www.phoca.cz)</author>
<creationDate>30/09/2022</creationDate>
<creationDate>01/10/2022</creationDate>
<authorEmail></authorEmail>
<authorUrl>https://www.phoca.cz</authorUrl>
<copyright>Jan Pavelka</copyright>
<license>GNU/GPL</license>
<version>4.0.1</version>
<version>4.0.2</version>
<description>COM_PHOCAGUESTBOOK_XML_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>
<projectName>PhocaGuestbook</projectName>
Expand Down
14 changes: 14 additions & 0 deletions site/controllers/phocaguestbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function submit() {
}
$logging->captchaid = $captcha_id;

$store_ip = $params->get( 'store_ip', 1 );

// Save params
$model->setState('params', $params);

Expand Down Expand Up @@ -121,6 +123,14 @@ function submit() {
}
$logging->ip = $data['userip'];

// Anonymize IP - for logging now, for data before saving in model
if ($store_ip == 0) {
$logging->ip = 'anonymous';
}




//captcha
switch ($params->get('captcha_id')) {
case 1: //COM_PHOCAGUESTBOOK_JOOMLA_CAPTCHA -> use diffent fields
Expand Down Expand Up @@ -433,6 +443,10 @@ function submit() {

// CHECKS DONE - store entry

if ($store_ip == 0) {
$data['userip'] = 'anonymous';
}

$msg = '';
if ($model->store($data)) {
$logging->postid = $data['id'];
Expand Down
7 changes: 7 additions & 0 deletions site/models/guestbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function store(&$data) {
$uri = Uri::getInstance();
$app = Factory::getApplication();
$params = $this->getState('params');
$store_ip = $params->get( 'store_ip', 1 );

// cat id test
$id = $this->getState('category.id');
Expand Down Expand Up @@ -83,6 +84,12 @@ function store(&$data) {
$data['published'] = $params->get('review_item', 1);
}
$data['ip'] = $_SERVER["REMOTE_ADDR"];

if ($store_ip == 0) {
$data['userip'] = 'anonymous';
$data['ip'] = 'anonymous';
}

$data['date'] = gmdate('Y-m-d H:i:s'); // Create the timestamp for the date


Expand Down

0 comments on commit 2f46b8e

Please sign in to comment.