Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Table Wrapper v1.0 (Read 6439 times)
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Table Wrapper v1.0
Dec 23rd, 2008 at 5:01pm
Print Post  
Hey everyone,

I do alot of developing over on yabbforum but this is actually my first released mod. What I thought of when I first began creating this was "Why do rounded corners have to be so difficult?". I dont know if many of you have tried, but I have, and it was a pain! My mod for a very rounded forum came out to be 120+ steps! So basically, what I tried to do is minimize the coding for making such adjustments in one easy to edit area and allow for extensive customization.

Now comes the Table Wrapper. In a sense, this "wraps" any element, object, section of a webpage in a "wrap" that can style anything around it. For instance, if you wanted rounded borders around a category you could just put in a reference in the .template file that would instantly make all categories have a frame around them with smooth blended corners. Except...You would have to make this in html, code CSS, and put it into the template file!

The Table Wrapper makes an easy admin interface where you can create an infinite amount of wraps and name each. Each wrap has an editable code bit that will be placed above and one below an object that you want to wrap. So you can make the top half the upper portion of a table with 3 cells (one left corner, one middle area, and one right corner) then a new row with an unclosed cell that spans 3 columns. The bottom could be the closing of the above cell and 3 more cells in another row for a bottom left, middle, and right cell. The content (what you wrap) would be placed inside that center table cell and effectively be wrapped. The admin interface also gives access to the TableWrap.css which is where you should store any CSS stylings that you apply to ALL the wraps you make. So remember, wraps are all individual with their own HTML, the CSS applies to all of these.

Here is a view of the admin center interface. The only "option" available is whether to turn the feature on and off.

Under "Edit Template Wraps" you can create a new wrap with whatever name you wish. This will add it to the dropdown menu below. Next, to make code that will be placed above a wrapped object, type in the upper textarea. CONTENT between the two represents the content to which you will be wrapping. The lower text area is where you should put code that will display beneath a wrapped object, and of course either is optional.

On the right you will notice the CSS editor. The CSS for the wraps is stored separately from the rest of the .css files, and is editable here for less switching back and forth between pages. However, this css is editable with the styles editor if you switch to source view and use the dropdown box. This one CSS stylesheet will be applied to all of your wraps. So if you have multiple wraps with different CSS styles, they still all go in one file.

You can switch between wraps and create new wraps as well as delete them without ever actually editing a file. Everything is stored locally until you hit save. So nothing you do will effect how the site looks as you are doing it until you hit save. So if you do accidently delete something, just hit refresh. (although this will lose any other changes you have made since opening the page).

I have provided two default wraps and a CSS stylesheet with the MOD. The first wrap is a simple all around wrap with four rounded corners. The second is a top and bottom only wrap with four rounded corners. They are dark blue to demonstrate on my own forum at:
calvars.elementfx.com/yabb2/YaBB.pl
The wrap on the categories is "default" and the wrap on the info center blocks is called "sides".
Of course, you will have to change the image links and colors in the stylesheet if you want them to look different. Or of course, make your own.  Wink

You can see in the default wrap that the upper text area ends with a <td> tag that is not closed. This is because the CONTENT (the object you wrap) will be placed inside this cell, as it is closed </td> in the lower textarea. Basically, with two different sections placed on either side it leads to unlimited customization.

Last, you may be wondering "How do I actually wrap something?". Its easy! In the .template files or .pl files if need be, all you have to do is type {tablewrap NAME} above the content to wrap and {tablewrapend NAME} below the content. NAME should be the name of whichever wrap you wish to use at that location. Pretty simple!

Last but not least, pictures of the interface and results:
http://www.calvars.com/gac/images/tablewrap1.gif
http://www.calvars.com/gac/images/tablewrap2.gif

The .zip file includes:
TableWrap.MOD - apply to clean forum (will work with most mods, very few actual code changes).
TableWrap.pl - Upload ASCII to Admin/
tablewrap.txt - Upload ASCII to Variables/
tablewrap.css - Upload ASCII to yabbfiles/Templates/Forum
TableWrap.lng - Upload ASCII to Language/English

This was designed on a 2.3.1 CVS forum, however so few actual code changes are made that it shold work on 2.3. Please let me know.

Suggestions are welcome, bugs are welcome, and enjoy!
« Last Edit: Jan 4th, 2009 at 5:45pm by Unilat »  

TableWrapper.zip ( 5 KB | Downloads )
Back to top
WWWAIM  
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #1 - Dec 23rd, 2008 at 10:05pm
Print Post  
Agh, missed a line in the MOD file. For those who already downloaded find in subs.pl in sub template:
Code
Select All
	$yystyle  = qq~<link rel="stylesheet" href="$forumstylesurl/$usestyle.css" type="text/css" />\n~; 



and add before:
Code
Select All
	unless ($twrapload == 1) { require "$vardir/tablewrap.txt"; } 



sorry!
     
  
Back to top
WWWAIM  
IP Logged
 
Captain John
Senior Member
****
Offline


Pass to Port !

Posts: 264
Location: Reno Beach
Joined: Jan 18th, 2007
Gender: Male
Re: Table Wrapper v1.0
Reply #2 - Dec 24th, 2008 at 1:37am
Print Post  
Has the zip been updated or must apply the edit ?
  

Love to live and love on the water
Back to top
 
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #3 - Dec 24th, 2008 at 3:10am
Print Post  
.Zip was updated  Wink
  
Back to top
WWWAIM  
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #4 - Jan 3rd, 2009 at 8:43pm
Print Post  
Anyone who has downloaded this, please provide feedback. I have yet to figure out whether it works or not and/or any suggestions or opinions..
  
Back to top
WWWAIM  
IP Logged
 
chillipepper
Full Member
***
Offline


I love YaBB 1G - SP1.2!

Posts: 189
Joined: Jul 1st, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #5 - Jan 4th, 2009 at 4:30pm
Print Post  
Hi Unilat..I just thougt i would give this a try on an 2.3 board it install ok..but when i went into admin center and try it i got this error


Error: Untrapped Error :
Can't locate ./Admin/TableWrap.pl in @INC (@INC contains: C:/perl/site/lib C:/perl/lib . ./Modules) at C:/xxxxx/xxxxx/test/YaBB2/cgi-bin/yabb2/AdminIndex.pl line 127.
  
Back to top
 
IP Logged
 
chillipepper
Full Member
***
Offline


I love YaBB 1G - SP1.2!

Posts: 189
Joined: Jul 1st, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #6 - Jan 4th, 2009 at 4:34pm
Print Post  
am just wonderin if am missin some kind of modules to run this mod
  
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Table Wrapper v1.0
Reply #7 - Jan 4th, 2009 at 4:39pm
Print Post  
Quote:
Error: Untrapped Error :
Can't locate ./Admin/TableWrap.pl


Tongue
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
chillipepper
Full Member
***
Offline


I love YaBB 1G - SP1.2!

Posts: 189
Joined: Jul 1st, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #8 - Jan 4th, 2009 at 5:10pm
Print Post  
Thanks jet Wink i upload file TableWrap.pl - Upload ASCII to Sources/  like says in 1st post Lips Sealed
  
Back to top
 
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #9 - Jan 4th, 2009 at 5:46pm
Print Post  
Good catch chillipepper, I updated my first post  Wink
  
Back to top
WWWAIM  
IP Logged
 
chillipepper
Full Member
***
Offline


I love YaBB 1G - SP1.2!

Posts: 189
Joined: Jul 1st, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #10 - Jan 6th, 2009 at 3:48pm
Print Post  
@Unilat looks like a great mod.But i just dont understand how to use it Grin Grin
I sort of tryed to put rounded coners on an default template also the cat headins Sad no joy..any tips or how to would be great  Wink
  
Back to top
 
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #11 - Jan 6th, 2009 at 10:51pm
Print Post  
Well, lemme try to explain  Wink

Say you want to have a simple border. And it looks something like this:

Code
Select All
<div style="padding:1px;background-color:#fff000">Hi!</div> 



This would put a div around "Hi!". So basically, imagine "Hi!" as something that you want to put a border around, anything. Take what is on the left side of it (top) and put it in the top box. Everything to the right will go in the bottom box. So basically the top box is code on one side of what you wrap and the box on bottom is the code on the other side.

of course, rounded corners is more in depth. You have a table with the top 3 cells (one top left corner, one middle that stretches, one top right corner) then a new row. The new row would have a left cell for the left side that stretches, then an open cell <td>. All that would go in the top box. Then the bottom box would have </td> and then another cell for the right side, a new row with 3 cells for bottom left, bottom middle, and bottom right, then the end of the table.

Everything up to the open <td> would go on the left of what you wrap in the code, and </td> would close the cell on the right side in the code. Then whatever you wrapped would be in that middle cell.

I hope that helps explain it. Take a look at the default wraps that I provided, the first one is the example that I just described.
  
Back to top
WWWAIM  
IP Logged
 
Fps_Brian
Full Member
***
Offline



Posts: 130
Location: Beach Haven
Joined: Aug 14th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #12 - Jan 27th, 2009 at 5:20pm
Print Post  
Installed with no problems, very easy to use!!! Just need to change a few things in my template to get it just right...

When I have this turned off is there a way to not have {tablewrap name} to display on my page?
  

www.omgot.org
65+ mods installed
Back to top
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Table Wrapper v1.0
Reply #13 - Jan 28th, 2009 at 12:31am
Print Post  
Hmm. Good Point. Heres the fix in subs.pl :

Code
Select All
	########## Table Wrapper ############
	if($enabletwrap) {
		$output =~ s~(<|{)tablewrap\s+(.+?)(}|>)~$tablewrap{$2}~g;
		$output =~ s~(<|{)tablewrapend\s+(.+?)(}|>)~$tablewrapend{$2}~g;
	}
	else {
		$output =~ s~(<|{)tablewrap\s+(.+?)(}|>)~~g;
		$output =~ s~(<|{)tablewrapend\s+(.+?)(}|>)~~g;
	}
 



Will notify when .zip has been updated.
  
Back to top
WWWAIM  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint