| Author |
Post |
|
|
#1 Sat May 19, 2007 3:59 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
uPortalThis file was submitted by the poster at the posted timeUseBB Version: v1.0.x File Version: v1.0.1 Demo: http://usebbzone.comThis modification adds a fully functional portal to your useBB forum. Features: * Sortable Box positions * Left/Right box positions * Permissions per portal box * Edit, delete, disable portal boxes * Can create plain HTML or PHP driven boxes * Support's add-ons * Easily edit all add-on settings from one location * Easily add add-ons. * Setable left and right box widths **UPDATE v1.0.2To update, please re-upload portal.tpl.php and latest_posts.php.- Fixed template issue with Latest Posts module. - Added "stripslashes" to Latest Posts module. **UPDATE v1.0.1 - Added default variable $portalbox_width. Makes it easier to switch portal box positions. - Updated add-ons to reflect the new default variable. - Updated latest_posts.php to include TABLE_PREFIX Download This File« Last edit by Gaia on Wed Mar 11, 2009 10:22 am. »
|
|
|
#2 Sat May 19, 2007 4:01 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
How To Create Add-OnsuPortal requires that all add-ons use .php extensions. Any other file extensions will be ignored. Database ExplainedSettings are all saved in one row in the table usebb_settings. You can create an add-on with no settings required or with 1 or more settings reqired. You cannot create an add-on that requires multiple rows of data within the usebb_portal_settings table. If you need it, then just create your own table, acp module ( categorized under uPortal acp module ), etc. The box can still be added on the same way as the others on the end user side, except the settings will be on a different section then the rest. Creating an add-on with one setting or more required, is a little more tricky. You will need to create a row in the database table usebb_portal_settings. The table has the following fields: idThis is an auto increment, nothing you need to do with this. heading_titleThis is the name of your add-on. So, My Add-On. titlesThis depends on the number of settings you have. If you have one, just add in the one title. If you have more then one, add in each title, separated with a comma. Setting One Title,Setting Two TitledescrThis depeonds on your titles. You will want them to correspond to each other. Also separated with a comma. This is my setting one title description,This is my setting two title descriptionbox_idDon't need to worry about this part. Leave it blank. The end user will set this when they create the portal box. file_nameThis needs to be the same file name as the add-on you created. So, if i created the file my_addon.php, that is what I would put there my_addon.phpDefault ValuesThere are 3 main default values. These are as follows: $titleThis is the title that the end user set for the add-on. You need to use this as the table header name to reflect the end users settings. $portalbox_widthThis assigns a width to the portal box, depending which position it is. $portalbox_width needs to be used when parsing the table head of any add-on as: {portalbox_width}. The last default values are the add-on settings themselves. They are stored in an array, as numeric values. So, if there are 2 settings, then you will get each setting by using: $settings['0']; //This is the first setting $settings['1']; //This is the second setting. Default Template BitsThere are some default template bits that you can use in portal.tpl.php without having to edit the file. They are as follows: $templates['leftbox'] = '<table class="maintable" style="width:{portalbox_width};"> <tr> <td class="forumcat">{title}</td> </tr> <tr> <td> {content} </td> </tr> </table>';
Used for HTML based left boxes. Can also be used for static PHP boxes. $templates['rightbox'] = '<table class="maintable" style="width:{portalbox_width}"> <tr> <td class="forumcat">{title}</td> </tr> <tr> <td>{content}</td> </tr> </table>';
Used for HTML based right boxes. Can also be used for static PHP boxes. $templates['table_end'] = '</table>';
A simple table end. For PHP based boxes that loop the data for multiple rows. $templates['head_basic'] = '<table class="maintable" style="width:{portalbox_width};"> <tr> <td class="forumcat">{title}</td> </tr> <tr><td>';
$templates['body_basic'] = '{content}';
$templates['end_basic'] = '</td></tr></table>';
This basic layout is used for PHP data that loops data, but the data doesn't require seperate rows. Such as the top posters add-on. If there isn't a template bit that suits your needs, just open up portal.tpl.php and add in your own template bits under the comment. // // ADD-ON TEMPLATES BELOW! //
Default Layout <?php
/*
ADD-ON NAME
FOR: uPortal
No additional settings are needed for this add-on :).
*/
// // Die when called directly in browser // THIS IS REQUIRED // if ( !defined('INCLUDED') ) exit();
/* Get any settings if you need them. */ $limit = $settings['0']; $fid = $settings['1'];
/* Do your thing here. $my_data is just an example. */ $my_data = 'This will display inside a portal box to the left.';
/* Output your information. $title is a default variable. */ $template->parse('leftbox','portal', array( 'title' => $title, 'content' => $my_data, 'portalbox_width' => $portalbox_width ));
?>
« Last edit by Gaia on Mon May 21, 2007 12:10 pm. »
|
|
|
#3 Sat May 19, 2007 4:03 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
Misc Info and FAQChanging portal box widthsTo change the portal box widths, you need to open global.tpl.php. Find: 'portal_leftbox_width' => '150px', 'portal_rightbox_width' => '100%',
And change the values ( 150px, and 100% ) to the values you want. « Last edit by Gaia on Mon May 21, 2007 12:23 pm. »
|
|
|
#4 Sat May 19, 2007 4:10 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
Reserved for additional add-ons
|
|
|
#5 Mon May 21, 2007 8:00 am
|
|
Member
Registered: Jun 2006
Posts: 80
Location: Athens, Hellas
|
It's indeed a nice module Gaia. I am definitely going to install it to my first public UseBB forum. _______________ Visit UseBB Greece! “All human actions have one or more of these seven causes: chance, nature, compulsion, habit, reason, passion, and desire.” (Aristotle)
|
|
|
#6 Mon May 21, 2007 10:44 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
|
|
|
#7 Mon May 21, 2007 12:16 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
I know it's early, but it has been updated. Just re-upload all files ( excluding Pre-Made Files ) and the update is complete. Quote **UPDATE v1.0.1 - Added default variable $portalbox_width. Makes it easier to switch portal box positions. - Updated add-ons to reflect the new default variable. - Updated latest_posts.php to include TABLE_PREFIX
|
|
|
#8 Tue Aug 14, 2007 9:32 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
Topic merged with support topic. Try putting the query in separately. INSERT INTO `usebb_portal_boxes` VALUES (1, 'Navigation', '» <a href="portal.php">Portal</a><br />» <a href="index.php">Forum Home</a><br />» <a href="members.php">Memberlist</a><br />» <a href="members.php?act=staff">Staff List</a>', 'left', 0, '', 0, 0, ''); INSERT INTO `usebb_portal_boxes` VALUES (2, 'Top Posters', '', 'left', 1, 'top_posters.php', 0, 0, '5'); INSERT INTO `usebb_portal_boxes` VALUES (3, 'Latest Posts', '', 'right', 1, 'latest_posts.php', 0, 0, '5'); INSERT INTO `usebb_portal_boxes` VALUES (4, 'Statistics', '', 'left', 2, 'stats_box.php', 0, 0, ''); INSERT INTO `usebb_portal_boxes` VALUES (5, 'Latest News', '', 'right', 0, 'latest_news.php', 0, 0, '3,2');
And then put the other queries in. CREATE TABLE `usebb_portal_settings` ( `id` int(5) NOT NULL auto_increment, `heading_title` varchar(255) NOT NULL default '', `titles` varchar(255) NOT NULL default '', `descr` text NOT NULL, `box_id` int(11) NOT NULL default '0', `file_name` varchar(255) NOT NULL default '', UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
INSERT INTO `usebb_portal_settings` VALUES (1, 'Latest News', 'News Items,News Forum ID', 'The number of news items you want to display,The forum ID that the news will be extracted from', 5, 'latest_news.php'); INSERT INTO `usebb_portal_settings` VALUES (2, 'Top Posters', 'Number of Posters', 'Number of posters to show.', 2, 'top_posters.php'); INSERT INTO `usebb_portal_settings` VALUES (3, 'Latest Posts', 'Number of Posts', 'Number of posts you want displayed', 3, 'latest_posts.php');
|
|
|
#9 Wed Aug 15, 2007 9:08 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
Before you can insert the INSERT INTO query, you have to make sure you executed the query that creates the table. So, first execute this: CREATE TABLE `usebb_portal_boxes` ( `id` int(11) NOT NULL auto_increment, `title` varchar(255) NOT NULL default '', `content` text NOT NULL, `position` varchar(255) NOT NULL default '', `sort_id` int(5) NOT NULL default '0', `file` varchar(255) NOT NULL default '', `auth` tinyint(1) NOT NULL default '0', `off` tinyint(1) NOT NULL default '0', `settings` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
THEN you can execute the inserts
|
|
|
#10 Thu Aug 16, 2007 2:36 am
|
|
Member
Registered: Jun 2007
Posts: 4
|
Ok buanget (= ok and very nice). My database modification problem is solved. Now I'm going to the next step. Thanks. God bless you . . .
|
|
|
#11 Thu Aug 16, 2007 8:18 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
No problem, glad it worked.  .
|
|
|
#12 Mon Jan 28, 2008 6:32 pm
|
|
Member
Registered: Jan 2008
Posts: 3
|
i have the same error with him..i even follow all the instructions but i have an error.
|
|
|
#13 Tue Jan 29, 2008 8:54 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
What is the exact error? If it is the same as him, you will need to place each MySQL query separate.
|
|
|
#14 Sun Feb 03, 2008 6:10 am
|
|
Member
Registered: Jan 2008
Posts: 3
|
what do you mean? am i going to separate the MYSQL query with the insert? Same thing happen!
|
|
|
#15 Tue Feb 05, 2008 2:48 am
|
|
Member
Registered: Jan 2008
Posts: 3
|
problem solve. Thanks!
|
|
|
#16 Fri Dec 05, 2008 10:26 pm
|
|
Member
Registered: Nov 2008
Posts: 3
|
hey. I installed the portal a while ago. I have been noticeing that in some of the active topic subject lines there are \s in them eventhough the actual thread subject line doesnt contain them. Heres an example: http://i160.photobucket.com/albums/t173/jaxathon/examp.jpg« Last edit by Gaia on Wed Mar 11, 2009 10:08 am. »
|
|
|
#17 Tue Dec 09, 2008 12:42 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
Hey, sorry, didn't see this. I'll get that fixed for you tomorrow. Seems I forgot to add the function to remove slashes.
|
|
|
#18 Mon Dec 15, 2008 2:43 am
|
|
Member
Registered: Nov 2008
Posts: 3
|
Thanks =)
|
|
|
#19 Mon Dec 22, 2008 10:06 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
Sorry, it looks as though I won't get it updated till after the holidays. I'll get it up as soon as I can.
|
|
|
#20 Tue Dec 23, 2008 1:57 pm
|
|
Member
Registered: Nov 2008
Posts: 3
|
Gaia wrote Sorry, it looks as though I won't get it updated till after the holidays. I'll get it up as soon as I can.
Thats quite alright =) ive been quite busy myself too =)
|
|
|
#21 Wed Mar 11, 2009 10:23 am
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
This has been updated, fixed issues with latest_posts.php module.
|
|
|
#22 Mon Jul 20, 2009 6:18 pm
|
|
Member
Registered: Jul 2009
Posts: 1
|
the sql commands gave me trouble when i executed through the built in "executor" << lol any way, works great when i executed it through the phpmyadmin executor <<lol
Thanks allot Gaia!!
|
|
|
#23 Tue Aug 18, 2009 12:36 am
|
|
Member
Registered: Aug 2009
Posts: 1
|
Hello there, I need some assistance plz. First thing. I am crazy about the useBB forum soft, I have been seeking for something like this for a long time, how I found out about it was through some generic directory listing. I have bought IPB v3.0 just not long ago and after checking out useBB, I dropped IPB in a flash, mainly it is so bloated and etc. useBB is exactly what I've looked for, a fourm that is small as in being centered into the page as small as it is. I cant stand extended forums. Now, for the help I need. I have installed the portal but I cannot figure where in the acp to enable it and all. I followed the install instructions to a "T" with no errors. The useBB install I have is UseBB v1.0.9. Can you please help me to make this work? I've finally found a forum soft that I like and now I only have this one lil issue. Thanks EDIT:: OK, I have some of it fixed, I now can see in the ACP uPortal * Settings * Portal Boxes However, in the index of my forum, there is no link for the portal. Your downloaded file that has index.php I cannot figure out. I renamed my original index.php to index1.php and then uploaded yours. now when I try to access my forum, it sends me to some soite like mydomain.com which is a 404 error. Here is your file <?php
// // INDEX FILE FOR PORTAL REDIRECTION //
/********MANUAL EDITS --- PLEASE CHANGE THESE!**********/
// // This is the FULL PATH to the portal.php file. If you are not sure of this, please check your php.ini or ask your web host. // $path = '/home/user/public_html/forum/portal.php';
// // This is the URL to the portal.php file. // $p_url = "http://mydomain.com/forum/portal.php";
// // This is the URL to your forum index.php file. // $i_url = "http://mydomain.com/forum/index.php"; now this part I really dont get because I have never had to really enter in a path like this $path = '/home/user/public_html/forum/portal.php'; I normally would just put in http://mysite.com/forum « Last edit by No14u on Tue Aug 18, 2009 1:09 am. »
|
|
|
#24 Fri Aug 21, 2009 12:13 pm
|
|
Administrator
Registered: Jan 2006
Posts: 368
Location: Canada
|
You need to contact your host for the correct full path for your account. Quote // This is the FULL PATH to the portal.php file. If you are not sure of this, please check your php.ini or ask your web host.
|
|
|
#25 Thu Jun 03, 2010 12:26 pm
|
|
Member
Registered: May 2007
Posts: 6
|
First, very nice forum board and excellent modifications.
I have installed this uPortal addon to version 1.0.1.0 and I get the following error;
In file sources\modules\portal_settings.php on line 99:
E_NOTICE - Uninitialized string offset: 0
Can someone shine some light on this error?
The offending code is;
$content .= '<tr><td class="fieldtitle">'.stripslashes($title[$i]).'</td><td><input type="text" name="setting-'.$tmp.'-'.$i.'" value="'.$bsettings[$i].'" /><div class="descr">'.stripslashes($descr[$i]).'</div></td></tr>';
on line 99
|