Skip to content

Commit 1fa4548

Browse files
authored
Merge pull request #28 from tinoest/master
Minor bug fixes and changed release to 1.0.0 RC1
2 parents 0b8162b + 04d036f commit 1fa4548

40 files changed

+85
-92
lines changed

TinyPortal/Admin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Article.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*
@@ -498,21 +498,21 @@ public function getForumPosts( $post_ids ) {{{
498498
$adminFeatures = false;
499499
}
500500

501-
\loadMemberData($row['author_id']);
501+
\loadMemberData($row['author_id'], false, 'normal');
502502
\loadMemberContext($row['author_id']);
503503

504504
if($adminFeatures == true) {
505505
unset($context['admin_features']);
506506
}
507507

508-
// Store this member's information.
509-
if(!is_null($memberContext) && array_key_exists($row['author_id'], $memberContext)) {
510-
$avatar = $memberContext[$row['author_id']];
511-
$row['avatar'] = $avatar['avatar']['image'];
512-
}
513-
else {
514-
$row['avatar'] = '';
515-
}
508+
// Store this member's information.
509+
$row['avatar'] = '';
510+
if(!is_null($memberContext) && array_key_exists($row['author_id'], $memberContext)) {
511+
$avatar = $memberContext[$row['author_id']];
512+
if(array_key_exists('avatar', $avatar)) {
513+
$row['avatar'] = $avatar['avatar']['image'];
514+
}
515+
}
516516

517517
if(Util::shortenString($row['body'], $context['TPortal']['frontpage_limit_len'])) {
518518
$row['readmore'] = '... <p class="tp_readmore"><strong><a href="'. $scripturl. '?topic='. $row['id']. '">'. $txt['tp-readmore']. '</a></strong></p>';

TinyPortal/Base.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Block.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Category.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Database.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Integrate.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*
@@ -204,7 +204,7 @@ public static function hookBuffer($buffer) {{{
204204
}
205205

206206

207-
$string = '<a target="_blank" href="https://www.tinyportal.net" title="TinyPortal">TinyPortal 1.0.0</a> &copy; <a href="' . $scripturl . '?action=tportal;sa=credits" title="Credits">2005-2020</a>';
207+
$string = '<a target="_blank" href="https://www.tinyportal.net" title="TinyPortal">TinyPortal 1.0.0 RC1</a> &copy; <a href="' . $scripturl . '?action=tportal;sa=credits" title="Credits">2005-2021</a>';
208208

209209
if (ELK == 'SSI' || strpos($buffer, $string) !== false) {
210210
return $buffer;

TinyPortal/Mentions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Permissions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Shout.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Upload.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

TinyPortal/Util.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

database.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

package-info.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!DOCTYPE package-info SYSTEM "http://www.elkarte.net/site/package-info">
33
<package-info xmlns="http://www.elkarte.net/site/package-info" xmlns:smf="http://www.elkarte.net/">
44
<name>TinyPortal</name>
5-
<id>bloc:tinyportal</id>
5+
<id>tinyportal:tinyportal</id>
66
<type>modification</type>
7-
<version>1.0.0</version>
7+
<version>1.0.0 RC1</version>
88
<install for="1.1.* - 1.1.99">
99
<redirect url="">Installed!</redirect>
1010
<require-dir name="themes" destination="BOARDDIR" />

sources/TPArticle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

sources/TPBlock.php

+27-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*
@@ -10,6 +10,7 @@
1010
*/
1111
use \TinyPortal\Article as TPArticle;
1212
use \TinyPortal\Block as TPBlock;
13+
use \TinyPortal\Category as TPCategory;
1314
use \TinyPortal\Database as TPDatabase;
1415
use \TinyPortal\Util as TPUtil;
1516

@@ -169,8 +170,21 @@ function getBlocks() {{{
169170
foreach($categories as $row) {
170171
if(empty($row['author'])) {
171172
global $memberContext;
172-
loadMemberData($row['author_id'], false, 'minimal');
173-
loadMemberContext($row['author_id']);
173+
// Load their context data.
174+
if(!array_key_exists('admin_features', $context)) {
175+
$context['admin_features'] = array();
176+
$adminFeatures = true;
177+
}
178+
else {
179+
$adminFeatures = false;
180+
}
181+
182+
\loadMemberData($row['author_id'], false, 'normal');
183+
\loadMemberContext($row['author_id']);
184+
185+
if($adminFeatures == true) {
186+
unset($context['admin_features']);
187+
}
174188
$row['real_name'] = $memberContext[$row['author_id']]['username'];
175189
}
176190
else {
@@ -517,27 +531,22 @@ function editBlock( $block_id = 0 ) {{{
517531
}
518532
// collect all available PHP block snippets
519533
$context['TPortal']['blockcodes'] = TPcollectSnippets();
520-
get_catnames();
534+
535+
// Get the category names
536+
$categories = TPCategory::getInstance()->getCategoryData(array('id', 'display_name'), array('item_type' => 'category'));
537+
if(is_array($categories)) {
538+
foreach($categories as $k => $v) {
539+
$context['TPortal']['catnames'][$v['id']] = $v['display_name'];
540+
$context['TPortal']['article_categories'][] = array( 'id' => $v['id'], 'name' => $v['display_name'] );
541+
}
542+
}
543+
521544
get_grps();
522545
get_langfiles();
523546
get_boards();
524547
get_articles();
525548
$context['TPortal']['edit_categories'] = array();
526-
$request = $db->query('', '
527-
SELECT id, display_name as name
528-
FROM {db_prefix}tp_categories
529-
WHERE item_type = {string:type}
530-
ORDER BY display_name',
531-
array(
532-
'type' => 'category'
533-
)
534-
);
535549

536-
if($db->num_rows($request) > 0) {
537-
while($row = $db->fetch_assoc($request))
538-
$context['TPortal']['article_categories'][] = $row;
539-
$db->free_result($request);
540-
}
541550
// get all themes for selection
542551
$context['TPthemes'] = array();
543552
$request = $db->query('', '

sources/TPSSI.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

sources/TPSearch.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

sources/TPortalAdmin.php

+9-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*
@@ -11,6 +11,7 @@
1111
use \TinyPortal\Admin as TPAdmin;
1212
use \TinyPortal\Article as TPArticle;
1313
use \TinyPortal\Block as TPBlock;
14+
use \TinyPortal\Category as TPCategory;
1415
use \TinyPortal\Database as TPDatabase;
1516
use \TinyPortal\Permissions as TPPermissions;
1617
use \TinyPortal\Util as TPUtil;
@@ -83,8 +84,13 @@ function TPortalAdmin()
8384
// get the layout schemes
8485
get_catlayouts();
8586

86-
// get the categories
87-
get_catnames();
87+
// Get the category names
88+
$categories = TPCategory::getInstance()->getCategoryData(array('id', 'display_name'), array('item_type' => 'category'));
89+
if(is_array($categories)) {
90+
foreach($categories as $k => $v) {
91+
$context['TPortal']['catnames'][$v['id']] = $v['display_name'];
92+
}
93+
}
8894

8995
if(isset($_GET['id'])) {
9096
$context['TPortal']['subaction_id'] = $_GET['id'];
@@ -2213,28 +2219,6 @@ function get_articles()
22132219
}
22142220
}
22152221

2216-
function get_catnames()
2217-
{
2218-
2219-
global $context;
2220-
2221-
$db = TPDatabase::getInstance();
2222-
2223-
$context['TPortal']['catnames'] = array();
2224-
2225-
$request = $db->query('', '
2226-
SELECT id, display_name FROM {db_prefix}tp_categories
2227-
WHERE item_type = {string:type}',
2228-
array('type' => 'category')
2229-
);
2230-
if($db->num_rows($request) > 0) {
2231-
while($row = $db->fetch_assoc($request))
2232-
$context['TPortal']['catnames'][$row['id']] = $row['display_name'];
2233-
2234-
$db->free_result($request);
2235-
}
2236-
}
2237-
22382222
function tp_create_dir($path) {{{
22392223

22402224
require_once(SOURCEDIR . '/Package.subs.php');

sources/admin/TPAdminArticles.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @author tinoest
66
* @license BSD http://opensource.org/licenses/BSD-3-Clause
77
*
8-
* @version 1.0.0
8+
* @version 1.0.0 RC1
99
*
1010
*/
1111

sources/admin/TPortalAdmin.controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

sources/controllers/TPortal.controller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

sources/subs/TPortal.subs.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

themes/default/TPBlockLayout.template.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

themes/default/TPSearch.template.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

themes/default/TParticle.template.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @package TinyPortal
4-
* @version 1.0.0
4+
* @version 1.0.0 RC1
55
* @author TinyPortal - http://www.tinyportal.net
66
* @license BSD 3.0 http://opensource.org/licenses/BSD-3-Clause/
77
*

0 commit comments

Comments
 (0)