Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name / Version: Popup Graemlin Panel

Description: Allows you to limit the number of graemlins to be displayed on the posting pages and gives a link to click "More Graemlins" for a pop-up window where you can select from additional graemlins.

Working Under: UBB.Threads 6.3-6.4

Mod Status: Finished

Any pre-requisites: UBB.Threads 6.3-6.4

Author(s): JustDave

Date: 06/07/03

Credits: JoshPet, AllenAyers & Astaran for bug fixes and updates

Files Altered: /admin/edittheme.php, /admin/doedittheme.php, /languages/instant_markup.php, /templates/default/ubbt_instant_ubbcode.tmpl, ubbt.inc.php, /languages/admin/edittheme.php

New Files: graemlinpanel.php

Database Altered: none

Info/Instructions: This is really JustDave's genius. I simply updated the directions for 6.3. <img src="/forum/images/graemlins/smile.gif" alt="" />

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Attachments
83400-graemlinpanel.6.3 Folder.zip (0 Bytes, 314 downloads)

Last edited by Ian_W; 12/13/2003 4:50 AM.
Sponsored Links
Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Version: 6.3
URL: http://forum.f-bodyhideout.com

Added this mod. I set the Graemlins number to 15, but it won't display any Graemlins initially when attempting to post or reply however, it will give you a link to the additional Graemlins, which are all the Graemlins.

Any idea?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Is your theme file writable? When you go back - is the number 15 still there?

Do you currently have more than 15 graemlins?

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Hi, my modification suggestion for the cool hack (close button added in graemlinpanel.php):


-----

$graemlinpanel
$tbclose

<!-- Extra Close button -->
<br><div align="center">
<input type="button" value="{$ubbt_lang['CLOSE_WINDOW']}" onClick="self.close()" class="buttons">
</div>


</body>
</html>
UBBTPRINT;


---
and in language files something like this:
$ubbt_lang['CLOSE_WINDOW'] = "close window";

Last edited by caymuc; 06/15/2003 5:49 PM.
Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
[]JoshPet said:
Is your theme file writable? When you go back - is the number 15 still there? [/]

Not sure what you mean by my theme file being writeable...?

[]Do you currently have more than 15 graemlins? [/]

Yes, I have more than 15 Graemlins.

Sponsored Links
Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Ahhhh....for some reason, when I go into the Admin panel and edit the theme setting for the Max Graemlins....I enter my max number...and then click on update theme.inc.php the table goes blank...not showing me if the field has been updated....I go back to the page and I see that it is not saving any of the max numbers I'm inputting.

Any ideas?

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Mmmmm, actually any changes that I'm making in the theme.inc.php file are not being saved. I just wanted to experiment with this file and change a few things to see if the same issue was happening with any of the other fields. Turns out that no matter what changes I'm making to the theme.inc.php file....it's not being saved.

Okay, now I'm really confused...even more so that usual...ouch, that's bad.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Make sure that the theme.inc.php file is world readable and writable.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
I'm a very new user to any type of code...and I'm trying to figure out why I can't get this hack to work.

In your instructions:

### Open edittheme.php and change this:

### Change this:


<p {$new['cellspacing']}>
{$ubbt_lang['CELLSPACING']}<br>
<input type=text size=5 name=cellspacing value={$theme['cellspacing']} class=formboxes>


### to this:


<p {$new['cellspacing']}>
{$ubbt_lang['MAX_GREM']}<br>
<input type=text size=5 name=max_graemlins value="{$theme['max_graemlins']}" class=formboxes>

<p {$new['cellspacing']}>
{$ubbt_lang['CELLSPACING']}<br>
<input type=text size=5 name=cellspacing value={$theme['cellspacing']} class=formboxes>

It lists <p {$new['cellspacing']}> twice in the code...is this correct?

Sponsored Links
Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Hmmmm, I've gone through all of the code and ensured that each file was edited as the instructions read...and still...no go.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You find that section and change it to that..... so essentially you add the other bit above it.


Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
[]JoshPet said:
You find that section and change it to that..... so essentially you add the other bit above it.

[/]

What I meant by this:

### Open edittheme.php and change this:

### Change this:


<p {$new['cellspacing']}>
{$ubbt_lang['CELLSPACING']}<br>
<input type=text size=5 name=cellspacing value={$theme['cellspacing']} class=formboxes>


### to this:


<p {$new['cellspacing']}>
{$ubbt_lang['MAX_GREM']}<br>
<input type=text size=5 name=max_graemlins value="{$theme['max_graemlins']}" class=formboxes>

<p {$new['cellspacing']}>
{$ubbt_lang['CELLSPACING']}<br>
<input type=text size=5 name=cellspacing value={$theme['cellspacing']} class=formboxes>

Was that the bold areas of what I'm changing the code to lists <p {$new['cellspacing']}> twice. Is that correct?

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Yeah, you simply add the first part to the edittheme.php
Alternativley you could say:

find:
Code
<p {$new['cellspacing']}> <br />{$ubbt_lang['CELLSPACING']}<br> <br /><input type=text size=5 name=cellspacing value={$theme['cellspacing']} class=formboxes>


and add before:
Code
<p {$new['cellspacing']}> <br /><p {$new['cellspacing']}> <br />{$ubbt_lang['MAX_GREM']}<br> <br /><input type=text size=5 name=max_graemlins value=\"{$theme['max_graemlins']}\" class=formboxes>




Last edited by Astaran; 08/05/2003 3:48 PM.
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I think you misunderstood smoknz28's question. He's asking about the duplicate occurence of {$new['cellspacing']}.

I was just looking at that myself. Shouldn't the first occurrence be {$new['max_graemlins']}?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I didn't see it until Dave pointed it out.

Dave is correct.... it's a typo/bad copy/paste job in the instructions.

I've corrected them and reattached the zip.... But Dave is right, it should be {$new['max_graemlins']}.



Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Well damn...here I was thinking I was losing more marbles upstairs...it's bad enough I only have a few more left.

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Okay gang...I got the code fixed, but I'm still having issues with getting the graemlins to display the way I'd like, which is showing only 8 at initial screen and then the user would have to click on 'More Graemlins' to see the additional ones available.

Is there anywhere in the code that I can code it into the config? If so, where do I find this...?

Also, this all had come about when I could not edit 'Theme Settings' within my Admin Panel.

See this post at InfoPop's Community.

Any help with this is GREATLY appreciated!

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Okay, being the rookie that I am with this coding schtuff...I found that the theme.inc.php file is where the changes are suppose to save to where I make in my 'Edit Theme Settings' in my Admin Panel.

Okay, well when I look at that page...I don't see anything relating to the graemlins. I would figure that there should be an area for this if I have the option to make changes in my Edit Theme Settings...

Here's what I'm seeing in the theme.inc.php file:

<?
/*
# UBB.threads, Version 6
# Official Release Date for UBB.threads Version6: 06/05/2002

# First version of UBB.threads created July 30, 1996 (by Rick Baker).
# This entire program is copyright Infopop Corporation, 2002.
# For more info on the UBB.threads and other Infopop
# Products/Services, visit: http://www.infopop.com

# Program Author: Rick Baker.

# You may not distribute this program in any manner, modified or otherwise,
# without the express, written written consent from Infopop Corporation.

# Note: if you modify ANY code within UBB.threads, we at Infopop Corporation
# cannot offer you support-- thus modify at your own peril
# ---------------------------------------------------------------------------
*/

// Theme variables

// Default style sheet
$theme['stylesheet'] = "infopop";

// What style sheets do you want to make available to your users
// Format: Filename without the .css extension: Description
// ie: 'stylesheet:The default style sheet,
// stylesheet2:Large font style sheet';
$theme['availablestyles'] = "
blackandblue:Black and blue,
desert-classic:Classic Desert,
frosted:Frosted,
greenday:Green Day,
infopop:Infopop,
largeblackandblue:Black and blue (large fonts),
largegreenday:Green Day (large fonts),
largetheblues:the blues (large fonts),
stylesheet:wild,
stylesheet2:desert,
stylesheet3:wild (large fonts),
stylesheet4:desert (large fonts),
theblues:the blues";

// Table cellpadding
$theme['cellpadding']= 3;

// Table cellspacing
$theme['cellspacing'] = 1;

// Default color for admin usernames
$theme['admincolor'] = "#FF0000";

// Default color for moderator usernames
$theme['modcolor'] = "#00AA00";

// Table width
// Percentage or integer
$theme['tablewidth'] = "95%";

// Default listing to flat or threaded mode
$theme['postlist'] = "flat";

// Default posts and reply listing to collapsed or expanded
$theme['threaded'] = "collapsed";

// Default sort order
// 1 - Descending Subject
// 2 - Ascending Subject
// 3 - Descdending Poster
// 4 - Ascending Poster
// 5 - Descending Date
// 6 - Ascending Date
$theme['sort'] = "5";

// Default number of topics per page
$theme['postsperpage']= "40";

// Defrault number of posts to be shown on a single page when viewing a
// thread in flat mode
$theme['flatposts'] = "25";

// Allow users to add a picture to their profile
$theme['PictureView']= "1";

// If allowing users to add pictures, what is the maximum width allowed
$theme['PictureWidth'] = "65";

// If allowing users to add pictures, what is the maximum width allowed
$theme['PictureHeight'] = "85";

// Show user's pictures with their posts
$theme['PicturePosts']= 1;

// Default textarea columns
$theme['TextCols'] = "60";

// Default Textarea rows
$theme['TextRows'] = "5";

// Which Time format to use
// short1 = 'MM/DD/YY 10:19 AM';
// short2 = 'DD/MM/YY 10:19 AM';
// short3 = 'YY/MM/DD 10:19 AM';
// short4 = 'DD/MM/YYYY 22:43";
// short5 = '22:43 DD/MM/YYYY";
$theme['timeformat'] = "short1";

?>

Like I said...I'm not finding an area that is set for the graemlins to display. Maybe I'm just not looking at the right file...? I don't know....but just trying to learn and get help from those of you who know more than this rookie.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Have you edited the theme file through the admin interface yet - the mod adds a box there - which you'll fill in the number of graemlins you want to display. But you need to edit it the first time.

If not - double check your edittheme.php and doedittheme.phh steps. I've installed this on dozens of sites, even with the other typo, it works.

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
[]JoshPet said:
Have you edited the theme file through the admin interface yet - the mod adds a box there - which you'll fill in the number of graemlins you want to display. But you need to edit it the first time. [/]

That's where this all came about....I clicked on the 'Edit Theme Settings' in my Admin Panel and I can see the box where I would input the number of graemlins I'd like to see initially listed. I input a number like 8 and after I click on 'Update theme.inc.php' the page just goes blank. No matter what I attempt to change on this page through my admin panel....and then click on Update.....it goes to a blank page. I'm sooo confused....

[]JoshPet said:
If not - double check your edittheme.php and doedittheme.phh steps. I've installed this on dozens of sites, even with the other typo, it works. [/][/]

Rechecking as this will be my 3rd time checking these two pages.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Well - you could add this:

// Max Graemlins
$theme['max_graemlins'] = "12";



into the theme file.... but if that's not working right, it'll probably get lost next time you edit.

Just tested that typo fix here - and it still works.

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Okay, here's the update:

edittheme.php = code is correct
doedittheme.php = code is correct

Still not working...damn, bummer....

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
This is just a snippet of my 'edittheme.php' but I do wonder if this is correct....

// --------------------------------------------------------------
// If we can't open the directory, use the current theme settings
$html -> open_admin_table();
echo "<tr><td class=darktable> </td><td class=darktable>{$ubbt_lang['STYLEFILE']}</td><td class=darktable>{$ubbt_lang['STYLENAME']}</td></tr>";

for ( $i=0; $i<$stylesize;$i++) {
$styles[$i] = ereg_replace("\.css","",$styles[$i]);
$checked = "";
if (isset($stylenames[$styles[$i]])) {
$checked = "CHECKED";
$stylenames[$styles[$i]] = ereg_replace(""","\"",$stylenames[$styles[$i]]);
}
else {
$stylenames[$styles[$i]] = "";
}
echo "<tr><td class=darktable><input type=checkbox class ="formboxes" name="stylename$styles[$i]" $checked></td>";
echo "<td class=darktable>$styles[$i]</td>";
echo "<td class=darktable><input type=text name="styledesc$styles[$i]" class="formboxes" value="". $stylenames[$styles[$i]] .""></td></tr>";
}
echo "</table></td></tr></table>";

echo "
<p {$new['max_graemlins']}>
{$ubbt_lang['MAX_GREM']}<br>
<input type=text size=5 name=max_graemlins value="{$theme['max_graemlins']}" class=formboxes>

<p {$new['cellspacing']}>
{$ubbt_lang['CELLSPACING']}<br>
<input type=text size=5 name=cellspacing value={$theme['cellspacing']} class=formboxes>

<p {$new['admincolor']}>
{$ubbt_lang['ADMINCOLOR']}<br>
<input type=text name=admincolor value="{$theme['admincolor']}" class=formboxes>

The echo statment that I've highlighted in bold...should that be there?

Joined: Aug 2003
Posts: 8
Junior Member
Junior Member
Offline
Joined: Aug 2003
Posts: 8
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /var/www/cellstreet.com/html/cgi-bin/ubbt.inc.php on line 1685

Fatal error: Call to undefined function: getmicrotime() in /var/www/cellstreet.com/html/cgi-bin/main.inc.php on line 16

line 1685 is the class user bit
// ########################################################################
// USER CLASS
// Define a class for the user object
// ########################################################################
class user {

line 16 is the $timea line
// Page load times
$timea = getmicrotime();

ive checked the files ive edited and they seem ok with the edits to the files i have made, i get this error when trying to get onto my forum, anyone any ideas how i can fix this?

Thanks
Rob

Joined: Aug 2003
Posts: 8
Junior Member
Junior Member
Offline
Joined: Aug 2003
Posts: 8
i seem to have fixed it, think i missed a } somewhere along the line,

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Any plans to get this working under 6.4?

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
This works for 6.4

I have it installed on my 6.4 board.

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Beautiful....works like a charm with 6.4.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Altered the first post to reflect this working under 6.4 - thanks for confirming.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Apr 2002
Posts: 15
Newbie
Newbie
Offline
Joined: Apr 2002
Posts: 15
Great work ...

My questions is .. :

If am using 6.4.x Advanced UBBT Code 2.2 but I want the gremlins to be displayed using the pop window...is it possible ? what's that best way to do it ? and is there a conflict between them ?

Thanks you for your time and effort.

Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554
Is there a way to set the default size of the window that opens up?

Thankyou in advance

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I was looking into it but you can't that I can see. although you can add scroll bars to it the width and height statements fail.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
In the ubbt_instant_ubbcode.tmpl file - this function which you add to the top:

function openGraemlinPanel() {
graemlinWindow=window.open('{$config['phpurl']}/graemlinpanel.php','graemlinpanel','scrollbars=yes,resizable=yes,width=300,height=400');
if (graemlinWindow.opener == null) graemlinWindow.opener = self;
}


Has the window height and width in it - edit it there.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
could have sworn I tried to add the height and weight and it didn't work..

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay now I remember.. if using the quickreply you need to also edit the code in showflat.tmpl also

function openGraemlinPanel() {
graemlinWindow=window.open('{$config['phpurl']}/graemlinpanel.php','graemlinpanel','scrollbars=yes,resizable=yes,width=300,height=400');
if (graemlinWindow.opener == null) graemlinWindow.opener = self;
}

change the 300 to whatever ya want.

Joined: Nov 2002
Posts: 554
Code Monkey
Code Monkey
Offline
Joined: Nov 2002
Posts: 554

We're not worthy

Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
Dozens eh? Leave it to me then to muck it up also.

I swear I followed the directions step by step. Only 'confusing' part is "Open instant_markup.php and add this:" but it doesnt' say 'where' to add it.

In my admin panel, under themes I am able to set a # of graemlins to be shows (18) but when I update the page, nothing further happens. I see see our '60ish' amount of graemlins on the 'post a new reply' thread.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
heya Kestral. Yeah that line is to be added to the bottom of the instant_markup.php in your language directory and should be added to the bottom. It only sets up a language string so that say you were French you could change it to French tell ya what if ya can Tell me what version of Threads you are adding this to and then upload using a zip your admin/edittheme.php, admin/doedittheme.php, /languages/instant_markup.php, /templates/default/ubbt_instant_ubbcode.tmpl, ubbt.inc.php,/languages/admin/edittheme.php files and I and others will take a look.

Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
I have 6.4 Went file by file & line by line again being sure of spacing and brackets. Uploaded the changed files this morning (with board closed). I see the 'max graemlins' in the admin panel, but nothing has changed on the 'post a thread' or 'reply to a thread' nor are there any errors shown.

Has to be something dumb Im missing.

Never did a zip file before and it wouldn't let me preserve directory of files, so languages/admin/edittheme.php is seperate
Attachments
110050-Graemlin.zip (0 Bytes, 12 downloads)

Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)