Jump to content

Using php includes instead of sitedocs


Guest
 Share

Recommended Posts

Greetings,

I have a series of pages I'd like to add to my store. They are the pages that many people create with sitedocs. BUT for me, I've found the FCK editor system to be cumbersome.

In order to use it, I have to create the page in dreamweaver, then copy the code, click edit page, click source code, paste code. Then test in three different browsers. Then debug in dreamweaver, then copy, repaste, etc, etc. If I could just fix bugs and upload it'd save me many steps. Especially, when I'm working in DW for all the stylesheets and everything.

I'd rather go through the steps necessary to use a php include.

I assume that several threads get close to doing what I want to do. Such as HERE and HERE. But they don't quite seem to be what I want. Nor do they seem to put all the steps together in one place so that my feeble brain can understand.

Here is my site:

http://70.47.23.37/

I used the FCK editor to create the "history" section. I'd prefer to do the rest of links across the top nav another way – along with links in the footer.

I assume I'll have to edit several files and probably create some .inc.php files and .tpl filee. But I don't quite understand how the whole thing works yet. (That's probably fairly obvious to those of you who do.)

Any assistance is greatly appreciated. I've searched the forums. But perhaps I'm not using the correct search terms. So, if you have a suggestion on that, thanks.

John.

P.S. Using CubeCart 3.0.10

Link to comment
Share on other sites

You could easily disable the FCKeditor and then you could simply paste your HTML code into the textbox.

One way to do that would be to simply rename or remove the /admin/includes/rte/editor/ folder. There are probably other ways too, but you'd have to look around to find them.

Link to comment
Share on other sites

You could easily disable the FCKeditor and then you could simply paste your HTML code into the textbox.

One way to do that would be to simply rename or remove the /admin/includes/rte/editor/ folder. There are probably other ways too, but you'd have to look around to find them.

Thanks Alan. I appreciate your suggestion. That would save me one step. And I'll go that route if I have to. But I'm hoping I can do it with some sort of include, rather than putting the code in the DB, via the site docs interface.

Maybe I wasn't clear enough. I wasn't actually using the "editor" part of the FCK editor anyway. I was pasting the source code from DW.

What I'm hoping to do is an include function so that I can edit the code in DW then simply upload the page to test and debug. Rather than edit code, copy, click over to my site admin, click edit, paste, save changes, yada yada.

If I have to pay someone a little bit o' coin for a clear tutorial, I will.

Thanks!

Link to comment
Share on other sites

What I'm hoping to do is an include function...

Here's what I would look into (since I haven't actually done it):

In /includes/content/viewDoc.inc.php, insert before this line (should be 38 in CC3.0.15):

if($lang_folder !== $config['defaultLang']){

the following (perhaps not perfect php code):


$view_doc->include("includes/docs/".mySQLSafe($_GET['docId'])."html");

(Maybe the "->" needs to be an "=", I don't know.)

Then comment out everything afterwards but the last two lines:


$page_content = $view_doc->text("view_doc");

?>

So, when a visitor clicks a siteDoc link, the form sends a URL containing "?act=viewDoc&docId=4" (for example). The new line above is going to use the "4" to construct "4.html" which will be found in the folder of your specification. The include will assign it to the already present variable and be processed out to the page's content normally.

Let us know if this works.

Link to comment
Share on other sites

Thx bsmither:

Here are the errors I received:

(using the "->")

"Fatal error: Call to a member function on a non-object in /home/crosscle/public_html/includes/content/viewDoc.inc.php on line 38"

When I inserted the "=" instead, I received this error:

"Fatal error: Call to undefined function: mysqlsafe() in /home/crosscle/public_html/includes/content/viewDoc.inc.php on line 38"

Thx for your suggestion. Any others?

:)

Thx Stevie68, but I don't know if I'm comprehending your suggestion. I think that would just show a link in the middle of the page where I'd like the content of history.php to be. Then clicking it would take me to history.php and it wouldn't have the header, side columns or footer. But maybe I'm misunderstanding.

Link to comment
Share on other sites

Thx bsmither:

Here are the errors I received:

Yeah, I also think it's a good idea to go over to CubeCartForums. There, you enter a new topic and I'll post the same response as I did here. Then one of the programming people can figure out what the PHP code should be.

But conceptually, I think this is what you want.

You might even try:

$view_doc=file_get_contents("includes/docs/".mySQLSafe($_GET['docId'])."html");

And did you copy "mySQLSafe()" capitalized as I wrote it?

Link to comment
Share on other sites

Google Show-Hide-Order Site Documents anywhere :)

Thanks Convict! Got it.

For those less experienced w/these forums who may be reading this thread wondering why Convict doesn't just provide a link to the answer, it's because there are rules regarding linking to other sites. At least I assume that's why.

Anyway, the above search with the Great Google does indeed offer the answer.

Thanks all who've helped on this issue! I'll post a final note once I implement the solution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...