41 Posts
Umair Hassan
11 years ago
4
Topic

Hi,


Some plugins uses SQL queries to get the article's data from database tables, so my question is that in this case how to render introtext field to hide seblod tags.


For Example:

$query = '
SELECT DISTINCT
categories.title AS cat,
'.($config['use_title_alias'] ? 'content.alias' : 'content.title').' AS title,
                content.introtext AS text,
content.id AS IID,
CASE WHEN CHAR_LENGTH(content.alias)
THEN CONCAT_WS(":", content.id, content.alias)
ELSE content.id END as ID,
CASE WHEN CHAR_LENGTH(categories.alias)
THEN CONCAT_WS(":", categories.id, categories.alias)
ELSE categories.id END as CID
FROM
#__content AS content
LEFT JOIN
#__categories AS categories
ON categories.id = content.catid
LEFT JOIN
#__users AS users
ON users.id = content.created_by
LEFT JOIN
#__content_frontpage AS frontpage
ON content.id = frontpage.content_id
WHERE
content.state = 1
                    '. $access_con .'
AND categories.published = 1
AND ( content.publish_up = '.$db->Quote($nullDate).' OR content.publish_up <= '.$db->Quote($now).' )
AND ( content.publish_down = '.$db->Quote($nullDate).' OR content.publish_down >= '.$db->Quote($now).' )
AND ( '.$sql_where.' )
'.$lang_filter.'
'.$frontpage_con.'
ORDER BY
'.$order_options.'
LIMIT
'.($config['startposition']).','.($amount + (int)$config['startposition']).';
';

As the result of above example, introtext will be included with seblod tags and all the field those have Custom->article->introtext storage.

Can you tell me how to change "content.introtext AS text," to make it compatible with Seblod.


Regards,

Umair

Get a Book for SEBLOD
11 years ago
3
Level 1

Hi umair,

Thank you for your post.

Before i respond to your question. Why you would like to apply an SQL query to display the value of the column "introtext" in database?

If your response is to display the content of the article, you have a "content" and "intro" view of any content type for that feature. SEBLOD stores datas in other tables in database. SEBLOD stores only an "ID" in "introtext" to retrieve all fields included in a view in a content type.

Regards,
Mehdi.

41 Posts
Umair Hassan
11 years ago
2
Level 2

Hi,

Thanks Mehdi for your valuable time.


Actually there is a plugin called GK4 highlighter, which have the above code to retrieve data. if you can suggest some other code please see below the php code file that plugin using:

Code

Plugin Link


I know that you don't support other plugins but if you can tell how to retrieve introtext data in php with SQL Query and without SQL Query.


Your help would be highly appreciated.


Best Regards,

Umair


41 Posts
Umair Hassan
11 years ago
1
Level 3

Hi,


Any help on the above please?


Regards,

11 years ago
0
Level 4

See my answer in your other topic.

Regards

Get a VIP membership