thanks so much for your software, i have been using this often from the old version to the new one, and this is my first support or technical request question.........
How do i get TOP 10, Latest 5 and FAQs listed under any category to have a small discription, lets say like 30 words....
-------------------
Title of FAQ
this would be where the small discription of the FAQ comes and ends with truncate or eclipse...
-------------------
thanks - alot
Adding 30 word discription to TOP10 or latest 5
Moderator: Thorsten
-
chaichai21
- Posts: 7
- Joined: Sat Aug 19, 2006 4:35 am
Hi,
you mean the first 30 words of the answer?
bye
Thorsten
you mean the first 30 words of the answer?
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
chaichai21
- Posts: 7
- Joined: Sat Aug 19, 2006 4:35 am
yes i mean the first 30 words or 40 words there shuld be some class or little function that i can put into the top 10 or lates 5 function in the functions.php file that would allow me to have a teaser of the first sentence (30 words or so = ofcourse it must be a fixed number so 30 is fine).
P.S, Man i was so scared of joining your community becuase i had removed all the copy right and link backs of the FAQ, and i was reading that its ok, once u dont remvove it in the back end and once u dont claim its your software - i was afraid i might have to pay. I have used you FAQ on about 8 different websites = all with different designs (this FAQ is TOP notch and so EASY to customise)
P.S, Man i was so scared of joining your community becuase i had removed all the copy right and link backs of the FAQ, and i was reading that its ok, once u dont remvove it in the back end and once u dont claim its your software - i was afraid i might have to pay. I have used you FAQ on about 8 different websites = all with different designs (this FAQ is TOP notch and so EASY to customise)
Hi,
you have to add the "content" column in the queries and use the function makeShorterText() from inc/funcions.php for that.
bye
Thorsten
you have to add the "content" column in the queries and use the function makeShorterText() from inc/funcions.php for that.
If you're tinking, that's the right way...chaichai21 wrote:P.S, Man i was so scared of joining your community becuase i had removed all the copy right and link backs of the FAQ, and i was reading that its ok, once u dont remvove it in the back end and once u dont claim its your software - i was afraid i might have to pay. I have used you FAQ on about 8 different websites = all with different designs (this FAQ is TOP notch and so EASY to customise)
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
chaichai21
- Posts: 7
- Joined: Sat Aug 19, 2006 4:35 am
Ok b4 i go and embarass myself = i am not a PHP expert + the only ever PHP function i have pulled of is doing a truncate of another script... I am fully able to customise your PHPmyFAQ to any design/look i want, and every new website i am trying something new. I can get into any part of the php files that any HTML/XHTML tags in there and chnage them as i feel - thats the extent of my PHP..
So where exactly do i put the word content? ok i am thinking maybe it s $CONTENT = or something like that, so would i put that there (its bolded below).......... Now the hard part is the shorter text function, how do i grat a long function into this function here? I am suppose that there is a string or global variable that calls this function, but where exactl do i put this?
So where exactly do i put the word content? ok i am thinking maybe it s $CONTENT = or something like that, so would i put that there (its bolded below).......... Now the hard part is the shorter text function, how do i grat a long function into this function here? I am suppose that there is a string or global variable that calls this function, but where exactl do i put this?
thanks for everyting = hh i was the guy who emailed u early on this year telling u that i wanted to convert your script into an Encyclopdiea, i just dont have the budget yet for the quote, but i am working on it:)function generateTopTen($language = '')
{
global $PMF_LANG, $PMF_CONF, $CONTENT;
$result = generateTopTenData($language, PMF_NUMBER_RECORDS_TOPTEN);
if (count($result) > 0) {
$output = '<ul class="list2">';
foreach ($result as $row) {
$output .= '<li><a href="'.$row['url'].'" title="'.$row['thema'].'">'.makeShorterText(PMF_htmlentities($row['thema'], ENT_NOQUOTES, $PMF_LANG['metaCharset']), 8).'</a><br/>';
$output .= "\t<span class=\"small\">".$row['visits']." ".$PMF_LANG["msgViews"].":</span></li>";
}
$output .= '</ul>';
} else {
$output = $PMF_LANG["err_noTopTen"];
}
return $output;
}
Hi,
I didn't test it but it should work. 
bye
Thorsten
that's wrong. Here's a patch for the Top10:chaichai21 wrote:So where exactly do i put the word content? ok i am thinking maybe it s $CONTENT = or something like that, so would i put that there (its bolded below).......... Now the hard part is the shorter text function, how do i grat a long function into this function here? I am suppose that there is a string or global variable that calls this function, but where exactl do i put this?
Code: Select all
/**
* generateTopTenData
*
* This function generates the Top Ten data with the mosted viewed records
*
* @param string
* @param int
* @param int
* @return string
* @access public
* @author Robin Wood <robin@digininja.org>
* @author Matteo Scaramuccia <matteo@scaramuccia.com>
* @since 2005-03-06
*/
function generateTopTenData($language = '', $count = PMF_NUMBER_RECORDS_TOPTEN, $categoryId = 0)
{
global $db, $sids, $PMF_LANG, $PMF_CONF;
$query = 'SELECT '.SQLPREFIX.'faqdata.id AS id, '.SQLPREFIX.'faqdata.lang AS lang, '.SQLPREFIX.'faqdata.thema AS thema, '.SQLPREFIX.'faqdata.content AS content, '.SQLPREFIX.'faqcategoryrelations.category_id AS category_id, '.SQLPREFIX.'faqvisits.visits AS visits FROM '.SQLPREFIX.'faqvisits, '.SQLPREFIX.'faqdata LEFT JOIN '.SQLPREFIX.'faqcategoryrelations ON '.SQLPREFIX.'faqdata.id = '.SQLPREFIX.'faqcategoryrelations.record_id AND '.SQLPREFIX.'faqdata.lang = '.SQLPREFIX.'faqcategoryrelations.record_lang WHERE ';
if (isset($categoryId) && is_numeric($categoryId) && ($categoryId != 0)) {
$query .= SQLPREFIX.'faqcategoryrelations.category_id = \''.$categoryId.'\' AND ';
}
if (isset($language) && PMF_Init::isASupportedLanguage($language)) {
$query .= SQLPREFIX.'faqdata.lang = \''.$language.'\' AND ';
}
$query .= SQLPREFIX.'faqdata.id = '.SQLPREFIX.'faqvisits.id AND '.SQLPREFIX.'faqdata.lang = '.SQLPREFIX.'faqvisits.lang AND '.SQLPREFIX.'faqdata.active = \'yes\' ORDER BY '.SQLPREFIX.'faqvisits.visits DESC';
$result = $db->query($query);
$returnArray = array();
$i = 1;
$oldId = 0;
while (($row = $db->fetch_object($result)) && $i <= $count) {
if ($oldId != $row->id) {
$data['visits'] = $row->visits;
$data['thema'] = $row->thema;
$data['content'] = makeShorterText($row->thema, 30);
if (isset($PMF_CONF["mod_rewrite"]) && $PMF_CONF["mod_rewrite"] == "TRUE") {
$data['url'] = $row->category_id."_".$row->id."_".$row->lang.".html";
} else {
$data['url'] = $_SERVER["PHP_SELF"]."?".$sids."action=artikel&cat=".$row->category_id."&id=".$row->id."&artlang=".$row->lang;
}
$returnArray[] = $data;
$i++;
}
$oldId = $row->id;
}
return $returnArray;
}
/**
* This function generates the Top Ten with the mosted viewed records
*
* @param string
* @return string
* @access public
* @author Thorsten Rinne <thorsten@phpmyfaq.de>
* @since 2002-05-07
*/
function generateTopTen($language = '')
{
global $PMF_LANG, $PMF_CONF;
$result = generateTopTenData($language, PMF_NUMBER_RECORDS_TOPTEN);
if (count($result) > 0) {
$output = "<ol>\n";
foreach ($result as $row) {
$output .= "\t<li><strong>".$row['visits']." ".$PMF_LANG["msgViews"].":</strong><br />";
$output .= '<a href="'.$row['url'] . '">'.makeShorterText(PMF_htmlentities($row['thema'], ENT_NOQUOTES, $PMF_LANG['metaCharset']), 8).'</a><br />'.$row['content']."</li>\n";
}
$output .= "</ol>\n";
} else {
$output = $PMF_LANG["err_noTopTen"];
}
return $output;
}bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
-
chaichai21
- Posts: 7
- Joined: Sat Aug 19, 2006 4:35 am
hahahahahah,
WOW man your stuff did not work:) = but without your guidance to tell me i would neva have gottten it. Man you are the best. Ok let me explain, again your script is just so straight forward and once your provide the blue-print someone as lame as me just has to think and try and try..
So Thorsten, this is what you did..
$data['content'] = makeShorterText($row->thema, 30); : Now i realised that this is only makes the title short as "thema" is supposed to mean title, and i you wanna make content short then you need to have content. so i repleaced this with the one below
$data['content'] = makeShorterText($row->content, 30); : Now that was the trick as i figured u were talking about content all the time.
Now the truth is i really wanted this for the most recent added topics. And i thought "GenerateTopTenData" was for both Top10 and latest4, but i looked further down the functions.php after the generatelatest5 function and found the actual data function for this, and i simply copy pasted all of Top 10 data genration into this... Well u can imagine i got a whole lot of errors, so i decided to go piece by piece, and looked at where you added "content variable" and added it accordingly to the top5. and WOW it works PERFECT.
Man thank you so much- i really appreciate this OK...
WOW man your stuff did not work:) = but without your guidance to tell me i would neva have gottten it. Man you are the best. Ok let me explain, again your script is just so straight forward and once your provide the blue-print someone as lame as me just has to think and try and try..
So Thorsten, this is what you did..
$data['content'] = makeShorterText($row->thema, 30); : Now i realised that this is only makes the title short as "thema" is supposed to mean title, and i you wanna make content short then you need to have content. so i repleaced this with the one below
$data['content'] = makeShorterText($row->content, 30); : Now that was the trick as i figured u were talking about content all the time.
Now the truth is i really wanted this for the most recent added topics. And i thought "GenerateTopTenData" was for both Top10 and latest4, but i looked further down the functions.php after the generatelatest5 function and found the actual data function for this, and i simply copy pasted all of Top 10 data genration into this... Well u can imagine i got a whole lot of errors, so i decided to go piece by piece, and looked at where you added "content variable" and added it accordingly to the top5. and WOW it works PERFECT.
Man thank you so much- i really appreciate this OK...