TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 03:58:32 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 60
  • Total: 60

article intro

Started by alhaudhie, April 20, 2008, 01:07:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie

i take this in installation board..

Quote from: bas123 on April 18, 2008, 10:23:14 PM
I have an update on this...

I discovered that if I add an article and check on the "Use Intro" button, the Intro does show up in the article view/preview page only, However, if I then edit the article (even just once), the radio button behavior described above kicks in.

I would like all articles displayed on the Front Page to be Intros Only, but if I submit the articles and then edit them, I loose the "Use Intro" option.

Is this a bug? or can anyone put me in the right direction.

any answer pls


ngoclanbaby86


InternetRebel

I have the exact same problem. After editing an article it's not possible to get the "use intro" option to work. I didn't look into it yet, but I think it's just an submit error in the page somewhere. When I switch on the option to use the intro directly in the SQL database, the option works as it should. So it -must- be just an error when submitting the edits.

InternetRebel

Hi,

First let me make perfectly clear that my PHP knowledge is very, very close to zero. I am however good in "analyzing" and in the past I was pretty good in coding in BASIC, which has a lot of similarities with PHP in my opinion. That said, I'd like to let you know that I "fixed" the Use Intro bug, but I don't even know what the hell I did exactly, so please backup your file(s) first! The whole fix consists of just editing one value in one file! :-D


Open TPortalAdmin.template.php

Find the part that reads:

<input align="middle" name="tp_article_switch'.$mg['id'].'" type="radio" value="html"' , $mg['useintro']>-1 ? ' checked="checked"' : '' ,'> '.$txt['tp-gohtml'] .'


(for me that was on line 1663)

Change it to:

<input align="middle" name="tp_article_switch'.$mg['id'].'" type="radio" value="html"' , $mg['useintro']==1 ? ' checked="checked"' : '' ,'> '.$txt['tp-gohtml'] .'


So, all that needs to be done is change >-1 to ==1!



I tested the following things to make sure my "fix" didn't fuck up anything else.

Created new HTML article with NO intro. Article looks okay, database entry looks okay. Radio button behaves as it should.
Edited the article to use intro. Article has intro on frontpage, database looks okay. Radio button represents correct (new) state. Read more link is visible etc. etc. etc.
Switched back to DO en DON'T use intro, everything keeps working okay.
Created PHP and BBC articles to make sure the "fix" doesn't affect those. All seems to be okay.
Created yet another HTML article, this time using an intro from the very start. Did some changing to DO and DON'T use intro and it all seems to keep working as it should.

I hope maybe someone can tell me exactly what the hell I did. :-P And please let me know if this fix also worked for others having this problem.

InternetRebel

#5
BTW, I am NOT using a WYSIWYG editor, so I hope this fix doesn't make any difference for people who do. Just wanted to let you know. ;-)

bas123

Brilliant hacking InternetRebel !!

This solves the Use Intro save issue  ;D

However (as was the case when I changed the field manually in the Database), The Intro display on the front page isn't parsed properly!

ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf<br /> <img height="72" alt="" width="77" align="right" vspace="9" src="/forum/tp-images/Image/user_1_dot1940.jpg" />bdgpibfpibbg<br /> ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf<br /> bdgpibfpibbgougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf<br /> bdgpougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf<br /> bdgpibfpibbg<br /> ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf<br /> bdgpibfpibbg<br />
Read more...


Shows up as:
Quoteougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf
 <img height="72" alt="" width="77" align="right" vspace="9" src="/forum/tp-images/Image/user_1_dot1940.jpg" />bdgpibfpibbg
 ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf
 bdgpibfpibbgougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf
 bdgpougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf
 bdgpibfpibbg
 ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf
 bdgpibfpibbg
 
Read more...
(Note that there are HTML line breaks in this code which show on the frontpage, but are hidden in the post) + also note that the gibberish is on purpose! as this is a quick test article!

Now in the Db here's the Value in the Intro Field (Field = intro | Type = text)

Quoteougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf&lt;br /&gt;
&lt;img height=&quot;72&quot; alt=&quot;&quot; width=&quot;77&quot; align=&quot;right&quot; vspace=&quot;9&quot; src=&quot;/forum/tp-images/Image/user_1_dot1940.jpg&quot; /&gt;bdgpibfpibbg&lt;br /&gt;
ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf&lt;br /&gt;
bdgpibfpibbgougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf&lt;br /&gt;
bdgpougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf&lt;br /&gt;
bdgpibfpibbg&lt;br /&gt;
ougeru eroug doug ohufdgoub gb ouihgohbgrpibrpi pihb gihbgs pihbgelbpg dpihgbighbgf&lt;br /&gt;
bdgpibfpibbg&lt;br /&gt;

It's been a while since I played around with MySQL but as I recall, the Db Table attributes may be set up incorrectly.

Any thoughts on this?

:smiley6600:

InternetRebel

Hi Bas123,

Tested your article on my installation with the exact same makeup (only other image) and it works just fine. Article is shown correctly in intro, correctly in complete article and the final data in my database is the same as yours. The intro field is also "text" on my side.

I'd be happy to help you troubleshoot this, so maybe give me some more info. Like; are you using a WYSIWYG editor to enter your text (which I'm not) and do you use any custom theme maybe? Since the resulting text in the database is the same at my end I think your problem must be somewhere else, like in your theme or maybe in your /Sources/Display.php due to some MOD? Speaking of which; do you have any MODs installed that might have an effect on your output?

For comparison, this is MY smf_tp_articles SQL buildup:

CREATE TABLE `smf_tp_articles` (
  `id` int(11) NOT NULL auto_increment,
  `date` int(11) NOT NULL default '0',
  `body` longtext NOT NULL,
  `intro` text NOT NULL,
  `useintro` tinyint(4) NOT NULL default '1',
  `category` smallint(6) NOT NULL default '0',
  `frontpage` tinyint(4) NOT NULL default '1',
  `subject` text NOT NULL,
  `authorID` int(11) NOT NULL default '0',
  `author` text NOT NULL,
  `frame` tinytext NOT NULL,
  `approved` tinyint(4) NOT NULL default '1',
  `off` tinyint(4) NOT NULL default '0',
  `options` text NOT NULL,
  `parse` tinyint(4) NOT NULL default '0',
  `comments` tinyint(4) NOT NULL default '0',
  `comments_var` text NOT NULL,
  `views` int(11) NOT NULL,
  `rating` text NOT NULL,
  `voters` text NOT NULL,
  `ID_THEME` smallint(6) NOT NULL default '0',
  `shortname` tinytext NOT NULL,
  `sticky` tinyint(4) NOT NULL,
  `fileimport` text NOT NULL,
  `topic` int(11) NOT NULL,
  `locked` tinyint(4) NOT NULL,
  `illustration` text NOT NULL,
  `headers` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

bas123

Quote from: InternetRebel on May 10, 2008, 02:02:33 PM
OK... Lets compare:

YOURS:CREATE TABLE `smf_tp_articles` (
  `id` int(11) NOT NULL auto_increment,
  `date` int(11) NOT NULL default '0',
  `body` longtext NOT NULL,
  `intro` text NOT NULL,
  `useintro` tinyint(4) NOT NULL default '1',
  `category` smallint(6) NOT NULL default '0',
  `frontpage` tinyint(4) NOT NULL default '1',
  `subject` text NOT NULL,
  `authorID` int(11) NOT NULL default '0',
  `author` text NOT NULL,
  `frame` tinytext NOT NULL,
  `approved` tinyint(4) NOT NULL default '1',
  `off` tinyint(4) NOT NULL default '0',
  `options` text NOT NULL,
  `parse` tinyint(4) NOT NULL default '0',
  `comments` tinyint(4) NOT NULL default '0',
  `comments_var` text NOT NULL,
  `views` int(11) NOT NULL,
  `rating` text NOT NULL,
  `voters` text NOT NULL,
  `ID_THEME` smallint(6) NOT NULL default '0',
  `shortname` tinytext NOT NULL,
  `sticky` tinyint(4) NOT NULL,
  `fileimport` text NOT NULL,
  `topic` int(11) NOT NULL,
  `locked` tinyint(4) NOT NULL,
  `illustration` text NOT NULL,
  `headers` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


MINE:
CREATE TABLE `smf_tp_articles` (
  `id` int(11) NOT NULL auto_increment,
  `date` int(11) NOT NULL default '0',
  `body` longtext NOT NULL,
  `intro` text NOT NULL,
  `useintro` tinyint(4) NOT NULL default '1',
  `category` smallint(6) NOT NULL default '0',
  `frontpage` tinyint(4) NOT NULL default '1',
  `subject` text NOT NULL,
  `authorID` int(11) NOT NULL default '0',
  `author` text NOT NULL,
  `frame` tinytext NOT NULL,
  `approved` tinyint(4) NOT NULL default '1',
  `off` tinyint(4) NOT NULL default '0',
  `options` text NOT NULL,
  `parse` tinyint(4) NOT NULL default '0',
  `comments` tinyint(4) NOT NULL default '0',
  `comments_var` text NOT NULL,
  `views` int(11) NOT NULL,
  `rating` text NOT NULL,
  `voters` text NOT NULL,
  `ID_THEME` smallint(6) NOT NULL default '0',
  `shortname` tinytext NOT NULL,
  `sticky` tinyint(4) NOT NULL,
  `fileimport` text NOT NULL,
  `topic` int(11) NOT NULL,
  `locked` tinyint(4) NOT NULL,
  `illustration` text NOT NULL,
  `headers` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ;

I use a plain text editor (either TextPad or Notepad++ {great for this})

Since I use CuteFTP , sometimes I'll download the file to a temp directory and edit using the above if I'm debugging or am worried about ftp logout, but if I'm doing a quick fix I'm confident with, I'll just use the Edit option with Codified which opens the file with QuteHTML (both from Globalscape).

Regarding your question about Mods and themes:

Here's my settings/versions:
Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v1.0.5 beta 1© Bloc | WM Theme based on Tolkien design by Bloc


I tried a test with the SMF Default Theme - Core; and it rendered the same problem - Article shows as text

I do have several Mods installed:
Mod Name / Version 
1. TinyPortal 1.052
2. Ad Managment 2.3 (I Just Love how he spelled Management)  :2funny:
3. Auto Embed Video Clips 2.1.5
4. Location on Member List 1.0
5. Previous and Next Links for Page Index 1.0
6. Zodiac_13Moon 2.2
7. EmailFlash 2.0 (NOT WORKING WITH THEME YET)
8. SMF Gallery Lite 1.8.3
9. Streaming 3 4.2.2b
10. Google Member Map 0.1
11. SMF 1.0.13 / 1.1.5 / 2.0 b3.1 Update 1.0
12. SMF Theme Contrast Fix 1.1
13. SMF Sitemap 1.2.1


I look forward to your input, InternetRebel   :up:

bas123

Update --- Since posting above, there's now a new problem.

I modified the one article I have running on the frontpage a couple of times. Now, not only is the "Use Intro" staying checked on "No", but the Radio Buttons for "Article type" ...
Type of article: 
HTML article
PHP article
BBC article
External article 
Are all remaining unchecked! and although the changes to the article itself are taking hold, the type and intro options will not change...

I checked the TPortalAdmin.template.php
(Which BTW for others monitoring this thread is located in Themes > Default)
and the previous changes remain intact!

TOO WEIRD   :tickedoff: