PDA

View Full Version : Layouts on non CMS


Jen
June 7th, 2007, 06:00 PM
Not sure if I will make any sense, but here goes...lol

Oh..sorry for not being around, I have been working on my site and I'm almost done..Can't wait...

Anyways, since my site is a non CMS site, I have to manually setup a template for the layouts and on that template I have setup the layout html code that users will copy and paste...

Now my question is this, if a user uploads a layout to my site, since the layout html code I set in place is designed for a specific layout file size, how can I set up something that I can allow all layouts...

I know I make no sense..It's hard to explain...

Here is an example of the layout code I have on my template..

<div class='content' style='position: absolute; left:100px; top:5px; width:100px; height:100px; overflow:auto;'><a href=http://sportyourspace.com title='Myspace layouts>Myspace layouts</a><br><a href=http://sportyourspace.com title='Myspace
Layouts'>Myspace Layouts</a></div><style>
.contactTable { width: 300px !important; height: 150px !important; padding: 0px !important; background-image: url('{image_path}');; background-attachment: scroll; background-position: center center; background-repeat: no-repeat; background-color: transparent; }
.contactTable table, table.contactTable td { padding: 0px !important; border: 0px; background-color: transparent; background-image: none; }
.contactTable a img { visibility: hidden; border: 0px !important; }
.contactTable a { display: block; height: 28px; width: 115px; }
.contactTable .text { font-size: 1px !important; }
.contactTable .text, .contactTable a, .contactTable img { filter: none !important; }
</style>
<style>
table table table td { vertical-align: top; !important; }
span.blacktext12 { visibility: visible !important; background-image: url('{image_path}'); background-repeat: no-repeat; background-position: center center; background-color: transparent; font-size: 0px; letter-spacing: -0.5px; width: 435px; height: 600px; display: block !important; }
span.blacktext12 img { display: none; }
</style>
<style type="text/css">
body {
background-color:ffffff;
background-image:url('{image_path}');
background-position:center center;
background-repeat:repeat;
background-attachment:fixed;
scrollbar-face-color:rgb(168,36,69);
scrollbar-base-color:rgb(168,36,69);
scrollbar-3dlight-color:rgb(255,255,255);
scrollbar-shadow-color:rgb(255,255,255);
scrollbar-darkshadow-color:rgb(255,255,255);
scrollbar-highlight-color:rgb(255,255,255);
scrollbar-track-color:rgb(168,36,69);
scrollbar-arrow-color:rgb(255,255,255);
}
table, tr, td {background:transparent; border:0px;}
table table table {background-color:edabc6;}
table table table {
border-width:2px;
border-color:FFFFFF;
border-style:dashed;
}
table table table table {border:0px;}
input {background-color:transparent !important;}
td, span, div, input, a, table td div div font,
body div table tbody tr td font {font-family:Georgia !important;}
td, span, div, input, table td div div font,
body div table tbody tr td font {color:000000 !important;}
.nametext, .whitetext12, .lightbluetext8, .orangetext15, .blacktext12,
.redtext, .redbtext, .blacktext10, .btext {color:c93778 !important;}
</style><style type="text/css">
a {color:9b62a4 !important; text-decoration:none !important; text-transform:none !important; font-weight:normal !important; font-style:normal !important;}
a:hover {color:85538d !important; text-decoration: none!important; font-style: normal !important; font-weight: bold !important; text-transform: uppercase !important; }
img {border:0px;}
</style>

Obviously not everybody follows the same coding rules when creating layouts..Im just curious how that will effect me...

If anyone has any clue as to what Im talking about, I could use your help, LOL

Thanks bunches
Jen

Selena
June 7th, 2007, 06:02 PM
if i were you i'd setup a Layout CMS for just layouts.

m2scripts.com has a decent one if you just want to integrate into a site.
I wouldn't know how to setup a user-submitted system without a CMS.

Sergio
June 7th, 2007, 06:03 PM
Yeah I recommend that one too, even though I'm having problems with it right now. But it seems to do the job if you fix the little bugs it has.

Jen
June 7th, 2007, 06:03 PM
I have that one but I'm not sure where I would begin to integrate it into my site and also allow for user uploads..

deep
June 7th, 2007, 06:06 PM
First of all is this for MySpace?

Then, exactly what do you mean "Now my question is this, if a user uploads a layout to my site, since the layout html code I set in place is designed for a specific layout file size, how can I set up something that I can allow all layouts..."

What you mean by specific layout file size?

Heres how I take care of layouts. I use mysql and put each layouts in a row with the code. Then when I display the codes, php fetches the layout code from each row and displays in a text box.

I have no clue what you are trying to do but it seems you are confused or maybe its just me :(

Sergio
June 7th, 2007, 06:08 PM
It comes with the ability for people to register. Then they submit the layout and you just approve it. Pretty simple.

As for integrating to the site, I'm not sure. I'm asking about it in their support forum right now.

deep
June 7th, 2007, 06:09 PM
oh i get it now :)

without CMS its really hard to do it. What you can do is when the user submits the code, use php to take the code and put it in a text file and upload it to your server. Then when you display the layouts, call each text file and display it in a textarea. Off course this is if you know PHP :(

otherwise its not easy :(
you have to take the long way and do it manually

Selena
June 7th, 2007, 06:09 PM
I'm pretty much familiar with the m2scripts CMS so if you need help i'm available for any questions you have. I basically know it inside and and out when it comes to customizing, since I've done so much with it for my site.

Jen
June 7th, 2007, 06:16 PM
Selena

I just might do that when Im ready, Im finishing some other touches now and I will PM you when Im ready...Do you think you could help with the user submissions too or is that a seperate issue?

@deep

How hard would that be to implement?


Here is what my site will look like...

Keep in mind this is still in the early stages and there are is no content on there yet and I still have more things to do, but this will give you an idea on how my site will run

http://sportyourspace.com/gal/

Selena
June 7th, 2007, 06:19 PM
I've never done user submissions but I'm sure it can't be that difficult compared to the rest of the CMS

Thefairies
June 7th, 2007, 06:19 PM
I'm in the same boat that you are in. I have to do everything manually for mysite. m2scripts Layout CMS works with different layouts but if you use yahoo web hosting it will not work.

Jen
June 7th, 2007, 06:20 PM
I gues the question would be, can user submissions be done using the ms2 layout script....lol

Selena
June 7th, 2007, 06:25 PM
yes m2scripts's layout CMS was actually made FOR user submissions but CAN be used to just manage your own layouts, as I have done. I don't like user submissions but jeremy860 has set it up on his site just fine :D

Thefairies
June 7th, 2007, 06:27 PM
yes they can but you have approve it.

Jen
June 7th, 2007, 06:27 PM
Oh thank goodness, I thought I was gonna have to eliminate layouts from my site since I didn't know what I could use....Shew...Okie Dokie...

Thanks so much for easing my mind, LOL

Jen
June 7th, 2007, 06:27 PM
yes they can but you have approve it.

I approve or will approve all images uploaded ;)

SlickEddie
June 7th, 2007, 06:35 PM
Actually, Jeremy isn't using the one from m2scripts for user submissions. He's using the one from LayoutCMS.com.

yes m2scripts's layout CMS was actually made FOR user submissions
but CAN be used to just manage your own layouts, as I have done. I don't like user submissions but jeremy860 has set it up on his site just fine :D

myspaceprodesigns
June 7th, 2007, 06:45 PM
if you need to create files (i.e., if you don't have a database), just pick a folder and set the permission to either 666 or 777 and put something like this in your form processor:

<?php
$code = trim($_POST['code']);
$folder = "path/";
$filename = date('nsG-yji');
$ext = ".txt";
$file = $folder . $filename . $ext;
$create = fopen($file, 'w') or die('error opening file');
fwrite($create, $code);
fclose($create);
?>

that will create a file called /path/date-time.txt which will contain the code for your layout. approving layouts would require much more code (or a CMS), but this is a quick way to let people add layouts without a database

marshall_26
June 7th, 2007, 07:12 PM
I have several sites and non of them use a cms, your talking alot of coding to get what you want. I agree with others here unless you know php, get a CMS system.

Personally I wouldn't suggest M2scripts though, last time I seen an M2scripts layout CMS system it was sloppy, required register globals to be on, and had a glitch in a section of code that didn't allow all jpgs to be uploaded.

Ofcourse if you know what your doing you can fix the jpg issue, but in order for it to run without globals it would need an entire rewrite.

M2 has a really nice layout generator though:)

Hope no one takes offense to the above post, it's all of course my personal opinion :)

Maybe try a cms sold here??

deep
June 7th, 2007, 08:21 PM
I would make a layout cms similar to mines but I duno if it will be worth it or not! :(
Also there MSLS so you can use that but MSLS isn't as easy to integrate into a site

Jen
June 8th, 2007, 08:10 AM
I cant afford MSLS right now. Im wondering....Since my site already has a signup for users, if installing one of these layout scripts will need an additional signup since it's different script from the site.

Also, I guess I can't break down layouts accordingy to the categories I have setup? Since my site is sports, of course all the layouts are sports related. I can't split them up into the different sports, can I?


@myspaceprodesigns
Would you be illing to take a look at my setup and see if that would be sufficient enough to handle and get your thoughts?

myspaceprodesigns
June 8th, 2007, 09:29 AM
you can do this in a few different ways. this is a very quick example (so double check my coding before you try to use it)

i've noticed that your site sets a cookie called "userid"

on the upload processing form, check if the userid is valid before the processing begins and add categories to your uploader. here's a quick example:

login.php (this is the file which verifies if someone is logged in or not. it's something you already have, though i don't know what you've named it):

//checkLogin() is whatever function you're currently using to validate a user
$logged_in = checkLogin();


upload.php (this is your upload form. it checks if you're logged in and if so, it shows the form and if you just uploaded a layout it gives the feedback that an upload has been done, otherwise it returns an error saying that you must be logged in to upload a layout):

<?php
if ($logged_in) {
$e = $_GET['e'];
if ($e == 'complete') {
echo "<p>Upload complete!</p>";
}
echo "<form action=\"process.php\" method=\"post\">
<label for=\"code\">Code</label>
<textarea name=\"code\" id=\"code\">Enter you code here</textarea>
<label for=\"category\">Category</label>
<select name=\"category\" id=\"category\">
<option value=\"football\">football</value>
<option value=\"basketball\">basketball</value>
<option value=\"baseball\">baseball</value>
<input type=\"submit\" value=\"submit\">
</form>";
} else {
echo "<p><strong>error:</strong> you must be logged in to upload new layouts.</p>";
}
?>

process.php (this is your form processor. first it checks if you're logged in. if so, it assigns the proper folder which contains all layouts within a category and names the file with your username - date - time so when you recall the file for display, you can use the explode function to show which user uploaded it and when. it also redirects you to the home page if you're not logged in. remember to set your folders to either 666 or 777)

<?php
if ($logged_in) {
$userid = $_SESSION['userid'];
$code = trim($_POST['code']);
$category = trim($_POST['category']);
$folder = $category . "/";
$filename = $userid . "-" . date('nsG-yji');
$ext = ".txt";
$file = $folder . $filename . $ext;
$create = fopen($file, 'w') or die('error opening file');
fwrite($create, $code);
fclose($create);
header('location: upload.php?e=complete');
} else {
header('location: http://sportyourspace.com');
}
?>