Donations

Help support Pro_News and become a member of our Sponsors Group
The tip jar is at PayPal, but does not require a PayPal account
User Info
Bienvenue Anonyme
Adhésion:
Dernier: Witewolf
Nouveau aujourd'hui: 0
Nouveau hier: 0
Tous: 151
Visiteurs en ligne:
Membres: 0
Visiteurs: 25
Bots: 2
Total: 27
Qui est Où:
Visiteurs:Support Forums
Descargas
Support Forums
Téléchargement
Support Forums
Support Forums
Pro News Articles
Support Forums
Mi Cuenta
Pro News Articles
Support Forums
Support Forums
Pro News Articles
Support Forums
Support Forums
Support Forums
Support Forums
Pro News Articles
Téléchargement
Nedlastninger
Downloads
Support Forums
Pro News Articles
Pro News Articles
Pro News Articles
Bots:Google > Support Forums
Baidu > Support Forums
Admin en Ligne:
Pas d'Admin en ligne!
Multilingual Article Bug
Multilingual Article Bug
Posté le: Sat Apr 24, 2010 2:55 pm
Hadn't noticed till today but if you try and display an article that is set to one language it won't display but goes to the default page. In the article function I added $currentlang to the declaration and that seems to have fixed it - not sure if that's right though...
In functions.php change line 530 from
function article($aid,$page='') {
global $BASEHREF, $db, $prefix, $cpgtpl, $gblsettings, $pnsettings, $pagetitle, $CPG_SESS, $module_name, $userinfo, $multilingual, $Blocks, $home;
to
function article($aid,$page='') {
global $BASEHREF, $db, $prefix, $cpgtpl, $gblsettings, $pnsettings, $pagetitle, $CPG_SESS, $module_name, $userinfo, $multilingual, $currentlang, $Blocks, $home;
Should I be looking to see if that is missing elsewhere too?
rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif- BetaTester

- Messages: 492
- Inscrit le: Aug 01, 2007
- Localisation: Chantilly, France
Re: Multilingual Article Bug
Posté le: Sun Apr 25, 2010 9:12 am
Thanks. Same fix is required on function submit_article (around line 2400). And in admin_functions.php for function admin_article (around line 1008).
Both of the above are for the newer Related Articles feature.
But I noticed something else too. In the following code in fucntions-php (around line 568 in my version):
if ($aid == '') {
if ($pnsettings['actv_sort_ord'] == '1') {
$sql .= ' LEFT JOIN '.$prefix.'_pronews_schedule as h ON a.id=h.id AND CASE s.art_ord';
$sql .= ' WHEN "9" THEN h.newstate="0" WHEN "10" THEN h.newstate="1" WHEN "11" THEN h.newstate="0" WHEN "12" THEN h.newstate="1" END';
}
$sql .= ' WHERE sid!="0" AND s.in_home="2"';
$sql .= ($multilingual) ? ' AND (alanguage="" OR alanguage="'.$currentlang.'")' : '';
} else {
$sql .= ' WHERE a.id='.$aid;
}
$sql .= ($multilingual ? " AND (alanguage='$currentlang' OR alanguage='')" : '');
it looks to me as if the first occurrence of the multilang test within the if statement is redundant and can be deleted. Any chance that you could test that for me sometime please, as you have a multilang setup already in place? Displaying a section which is set to display in True Home Only. You should see the multilang selection specified twice in the SQL call when logged in as Admin. Won't do any harm, but will make the SELECT clause slower. TIA - I had a full multilang setup back on Windoze but never got to setting up same on Linux (tough when you only speak English and American
).
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback- Site Admin

- Messages: 1229
- Inscrit le: Mar 18, 2006
Re: Multilingual Article Bug
Posté le: Wed Apr 28, 2010 10:28 am
Thanks have made those edits too.
As regards the second point - I made a section in true home only then viewed it via Pro_News/sid=9.html when logged in as admin and I can't see it having two language clauses in the SQL:
SELECT a.id aid, a.*, c.id cid, c.sequence, c.title ctitle, c.description cdescription, c.icon icon, c.forum_id cforum_id, s.id sid, s.sequence, s.title stitle, s.view view, s.admin sadmin, s.forum_id sforum_id, template FROM chantill_pronews_articles as a LEFT JOIN chantill_pronews_cats as c ON a.catid=c.id LEFT JOIN chantill_pronews_sections as s ON c.sid=s.id WHERE a.catid=c.id AND c.sid=s.id AND a.approved="1" AND a.active="1" AND (alanguage='english' OR alanguage='') AND display<>"2" AND c.sid="9" ORDER BY CASE s.secdsplyby WHEN 2 THEN c.sequence END ASC, display_order DESC, CASE s.art_ord WHEN 0 THEN posttime END DESC, CASE s.art_ord WHEN 1 THEN posttime END ASC, CASE s.art_ord WHEN 2 THEN posttime END DESC, CASE s.art_ord WHEN 3 THEN a.title END ASC, CASE s.art_ord WHEN 4 THEN a.title END DESC, CASE s.art_ord WHEN 5 THEN ratings END ASC, CASE s.art_ord WHEN 6 THEN ratings END DESC, CASE s.art_ord WHEN 7 THEN a.counter END ASC, CASE s.art_ord WHEN 8 THEN a.counter END DESC LIMIT 0,10
When I commented out that line it didn't seem to make any difference.
rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif- BetaTester

- Messages: 492
- Inscrit le: Aug 01, 2007
- Localisation: Chantilly, France
Re: Multilingual Article Bug
Posté le: Wed Apr 28, 2010 10:53 am
Interesting, extra conditional must get dropped out by MySQL parser.
Thanks, I'll remove from code.
FYI: About half way through including your 'allarts' code. Will be fully integrated, both ui and code. Adding RSS buttons (configurable as main, per sec, per cat) and Show/Hide Articles link (configurable as no articles, always articles, or show/hide link). Just have the config stuff and the show/hide switch to do. Only change (vs. addition) to your code was a mod to CSS so that display of articles was indented the same on non-reDesign themes.
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback- Site Admin

- Messages: 1229
- Inscrit le: Mar 18, 2006
Re: Multilingual Article Bug
Posté le: Wed Apr 28, 2010 11:03 am
So I'll delete that line too.
Looking forward to seeing the topics done properly!
Moving in progress this week so might be a while before I get back online properly..
rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif- BetaTester

- Messages: 492
- Inscrit le: Aug 01, 2007
- Localisation: Chantilly, France
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum
You cannot attach files in this forum
You cannot download files in this forum
Toutes les heures sont au format GMT











