Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
TAd
Worker
Worker



Joined: Oct 11, 2004
Posts: 127
Location: Oregon, USA

PostPosted: Wed Feb 23, 2005 10:35 pm Reply with quote

One of the things that I have been searching for that seems to be missing with all the releases of PHP-Nuke is a a consistency through out the different areas. Of course I am using in comparison the PHBB forums as well. I do realize that this is an Add on, however the input is more geared towards the average web user. For instance:

A user wants to write a faq, and does so such as this:

Quote:


How can I set up my D70 as a point and shoot?
Right out of the box, the Nikon D70 gives what I would call a flat recording response. Many functions are set to auto that a user may not be aware of. Here are some settings that may help you with your first images, and prevent some frustration.

Auto ISO : OFF
EV : +.3 to +.7 Generally .3 is good.
Auto WB : Set to -2 or -3
Hue : -3
Saturation : Enhanced
Tone Comp -1 (preserves detail)
Color Mode : Set as follows depending on your criteria.
sRGB (Color Space 1 & III) Used for Web and vieing.
aRGB (Color Space II) for images that are destined for Adobe Editing.
IIIa is a variation of sRGB III and provides for more vibrant Greens and Blues.
Ia is also a variation that reproduces skin tones well, used in potraits.


However, in order to do so the average user finds that the new statement looks like this because they did not use some HTML code.

Quote:


How can I set up my D70 as a point and shoot? Right out of the box, the Nikon D70 gives what I would call a flat recording response. Many functions are set to auto that a user may not be aware of. Here are some settings that may help you with your first images, and prevent some frustration. Auto ISO : OFF EV : +.3 to +.7 Generally .3 is good. Auto WB : Set to -2 or -3 Hue : -3 Saturation : Enhanced Tone Comp -1 (preserves detail)Color Mode : Set as follows depending on your criteria. sRGB (Color Space 1 & III) Used for Web and vieing. aRGB (Color Space II) for images that are destined for Adobe Editing. IIIa is a variation of sRGB III and provides for more vibrant Greens and Blues.Ia is also a variation that reproduces skin tones well, used in potraits.


This same thing holds true for "content" but not for News. Except that in the News section you have an option at the bottom to submit, or preview and select the format whith which it is entered into the database.

The options are as follows:
Extrans
HTML
Text

How difficult would this be to implement into the content, sections,reviews, etc. portions of PHP-Nuke?

Thank you very much for any input!

Best regards,
Thomas
 
View user's profile Send private message Yahoo Messenger
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Feb 23, 2005 10:48 pm Reply with quote

Try this (use faq as the test). In admin/modules/adminfaq.php find
Code:
function FaqCatGoAdd($id_cat, $question, $answer) {

    global $prefix, $dbi;
    $question = stripslashes(FixQuotes($question));
    $answer = stripslashes(FixQuotes($answer));
    sql_query("insert into ".$prefix."_faqAnswer values (NULL, '$id_cat', '$question', '$answer')", $dbi);
    Header("Location: admin.php?op=FaqCatGo&id_cat=$id_cat");
}
and replace with
Code:
function FaqCatGoAdd($id_cat, $question, $answer) {

    global $prefix, $dbi;
    $question = stripslashes(FixQuotes($question));
    $answer = nl2br(stripslashes(FixQuotes($answer)));
    sql_query("insert into ".$prefix."_faqAnswer values (NULL, '$id_cat', '$question', '$answer')", $dbi);
    Header("Location: admin.php?op=FaqCatGo&id_cat=$id_cat");
}
 
View user's profile Send private message
TAd







PostPosted: Thu Feb 24, 2005 12:35 am Reply with quote

Raven wrote:
Try this (use faq as the test). In admin/modules/adminfaq.php find
Code:
function FaqCatGoAdd($id_cat, $question, $answer) {

    global $prefix, $dbi;
    $question = stripslashes(FixQuotes($question));
    $answer = stripslashes(FixQuotes($answer));
    sql_query("insert into ".$prefix."_faqAnswer values (NULL, '$id_cat', '$question', '$answer')", $dbi);
    Header("Location: admin.php?op=FaqCatGo&id_cat=$id_cat");
}
and replace with
Code:
function FaqCatGoAdd($id_cat, $question, $answer) {

    global $prefix, $dbi;
    $question = stripslashes(FixQuotes($question));
    $answer = nl2br(stripslashes(FixQuotes($answer)));
    sql_query("insert into ".$prefix."_faqAnswer values (NULL, '$id_cat', '$question', '$answer')", $dbi);
    Header("Location: admin.php?op=FaqCatGo&id_cat=$id_cat");
}


That was a fast reply! I just tried to locate the file adminfaq.php and was not successfull. I then updated to the latest release in your downlods section as well Razz and am still unable to locate it. I did locate in the following directory:
nuke/modules/FAQ/admin/ the Index.php

that had that same line in it. I tried editing the code as posted above. After doing so, I was unable to "add" any new FAQ's. I thought it might be the the Breaks in HTML I had, so I edited those out as well and tried again. No luck on that go around.

Thank you very much for the help I appreciate it Raven Smile


PS an observation, when you goto edit a FAQ it comes up just as you typed it, spaces an all, that would lead me to believe when you were "viewing" a posted FAQ that the format is convereted from text in the database, to HTML. Thus stripping all the spaces and cramming it all together. Not sure if I have explained this correctly or not.
 
Raven







PostPosted: Thu Feb 24, 2005 12:44 am Reply with quote

In 7.6 it's in modules/FAQ/admin/index.php
 
TAd







PostPosted: Thu Feb 24, 2005 1:16 am Reply with quote

OK editted the code like the above, and again when I click add, the new FAQ does not get entered.
 
Raven







PostPosted: Thu Feb 24, 2005 1:22 am Reply with quote

It works here. hmmmmm
 
TAd







PostPosted: Thu Feb 24, 2005 1:25 am Reply with quote

I have created an Admin account for you if you want to try it out. I will PM you the info and the URL

Also this is a fresh install and no modifications have been done to it.

Sending the PM now. Thank you Raven
 
TAd







PostPosted: Thu Feb 24, 2005 10:03 am Reply with quote

Raven,

Thank you very much! By introducing me to the nl2br function you lead me to a fix! Please see below Smile

What would happen is I would input for the FAQ:

Test1

1
2
3
4
5

and get

Test1
12345

or

Test1

1

2

3

4

5

and get

Test1
12345

In the index.php located in modules/FAQ/

I replaced the following:

Code:
Line 52  $answer = stripslashes($row['answer']);


with

Code:
Line 52  $answer = nl2br(stripslashes($row['answer']));


and

Code:
Line 70  $answer = stripslashes($row['answer']);


with

Code:
Line 70  $answer = nl2br(stripslashes($row['answer']));


woohoo love php this morning : ) Thanks again Raven!

Best regards,
Tom

PS reverted to Original index.php in modules/FAQ/admin/
I did not make this modification to this particular file so as to keep the admin section uncluttered, however, when you edit the content of the FAQ, it brings the text back as input thus you are able to see the data as it would be viewed by users.

RavensScripts and woooohooo for the New Guy On The Block!
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©