Tricked Out News

Welcome to TON. This site is dedicated to development of addons for the RavenNuke™ CMS
Follow Us:
Tricked Out Mods: Forums

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TON 2.6
 
 
Post new topic   Reply to topic   print    Tricked Out News Forum Index -> Tricked Out News
View previous topic :: View next topic  
Author Message
Guardian
Blingaholic
Blingaholic


Joined: Nov 03, 2009
Posts: 22

Reputation: 17.4Reputation: 17.4

PostPosted: Sun Feb 13, 2011 7:59 am 
Post subject: TON 2.6
Reply with quote

News/admin/index.php

Notice: Undefined variable: $prevtad in modules/News/admin/index.php on line 2336
The logic for setting this var starts at line 2220 and is dependent on whether or not $displayta is YES
I haven't had time to dig through the code and even though the var naming convention isn't as self explanatory as I would use myself, I think $displayta may possibly relate to whether a topic advert is diplayed?
If that is the case, a possible fix might be;
FIND
Code:
$displayta =''._YES.'';

    $prevtad ='<br>'._TONPREVIEW.'<br>'.ads($topad).'<br>';
    }else{
    $displayta =''._NO.'';
    }


REPLACE WITH
Code:
$displayta =''._YES.'';

    $prevtad ='<br>'._TONPREVIEW.'<br>'.ads($topad).'<br>';
    }else{
    $displayta =''._NO.'';
   $prevtad = '';
    }


Notice: Undefined variable: $prevbad in News/admin/index.php on line 2346
Same applies here. The assignment of $prevbad depends on the code around 2226- 2229
FIND
Code:
$displayba =''._YES.'';

    $prevbad ='<br>'._TONPREVIEW.'<br>'.ads($bottomad).'<br>';
    }else{
    $displayba =''._NO.'';
    }


REPLACE WITH
Code:
$displayba =''._YES.'';

    $prevbad ='<br>'._TONPREVIEW.'<br>'.ads($bottomad).'<br>';
    }else{
    $displayba =''._NO.'';
   $prevbad = '';
    }
  
Back to top
View user's profile Send private message
bobby
Site Admin
Site Admin


Joined: Jan 20, 2009
Posts: 600
Location: North Carolina
Reputation: 543Reputation: 543Reputation: 543
votes: 4

PostPosted: Sun Feb 13, 2011 8:05 am 
Post subject:
Reply with quote

Thank you. There is also a bug with empty tags showing previous tags on the index. I am working on that as we speak.
_________________
Tricked Out News
  
Back to top
View user's profile Send private message
bobby
Site Admin
Site Admin


Joined: Jan 20, 2009
Posts: 600
Location: North Carolina
Reputation: 543Reputation: 543Reputation: 543
votes: 4

PostPosted: Sun Feb 13, 2011 8:18 am 
Post subject:
Reply with quote

To fix the mystery tags for articles that have no tags on the index, open modules/News/index and find:

Code:
// Start Tags Mod   

if ($showtags){
$db_tags_cloud = $db->sql_query("SELECT tag FROM ".$prefix."_tags WHERE whr=3 AND cid='$sid'");
   $verifica_esistenza_tag = $db->sql_numrows($db_tags_cloud);
   if($verifica_esistenza_tag>0){   
   $taglink = '<div class="tagindex"><img src="images/news/tag.png" alt="Tags" align="left" />&nbsp;';   
      while ($row = $db->sql_fetchrow($db_tags_cloud)) {
         $tag = addslashes(check_words(check_html($row['tag'], "nohtml")));
         $taglink .= '<a href="tags.html?amp;op=list&amp;tag='.urlencode($tag).'" title="'.$tag.'">'.$tag.'</a> ';
      }
      $taglink .= '</div>';   
   }
   $hometext = $taglink.$hometext;   
   }   
// End Tags Mod      


and replace with:

Code:
// Start Tags Mod   

if ($showtags){
$db_tags_cloud = $db->sql_query("SELECT tag FROM ".$prefix."_tags WHERE whr=3 AND cid='$sid'");
   $verifica_esistenza_tag = $db->sql_numrows($db_tags_cloud);
   if(!empty($verifica_esistenza_tag)){   
   $taglink = '<div class="tagindex"><img src="images/news/tag.png" alt="Tags" align="left" />&nbsp;';   
      while ($row = $db->sql_fetchrow($db_tags_cloud)) {
         $tag = addslashes(check_words(check_html($row['tag'], "nohtml")));
         $taglink .= '<a href="tags.html?amp;op=list&amp;tag='.urlencode($tag).'" title="'.$tag.'">'.$tag.'</a> ';
      }
      $taglink .= '</div>';   
   }else{
   $taglink='';
   }
   $hometext = $taglink.$hometext;   
   }   
// End Tags Mod         

_________________
Tricked Out News
  
Back to top
View user's profile Send private message
Guardian
Blingaholic
Blingaholic


Joined: Nov 03, 2009
Posts: 22

Reputation: 17.4Reputation: 17.4

PostPosted: Sun Feb 13, 2011 10:54 am 
Post subject:
Reply with quote

Nice catch, thanks.
I sent you mail also
  
Back to top
View user's profile Send private message
Guardian
Blingaholic
Blingaholic


Joined: Nov 03, 2009
Posts: 22

Reputation: 17.4Reputation: 17.4

PostPosted: Sun Feb 13, 2011 12:05 pm 
Post subject: PDF logo
Reply with quote

Just in case it interests anyone else, I just added my logo to the News PDF functionality. This is NOT the correct way to do it but it's a quick work around...
Add an images directory like this
nukeroot/classes/tcpdf/images
Add your logo image to that directory.

In modules/News/printpdf.php
change
Code:
// set default header data

$pdf->SetHeaderData('','',$sitename,$nukeurl);

to
Code:
// set default header data

//$pdf->SetHeaderData('','',$sitename,$nukeurl);
$pdf->SetHeaderData('your_logo.png','12', $sitename, $nukeurl);

You can change the '12' to whatever size you need as this is the image width

Also to stop downloaded articles being overwritten because of the file having the same filename all the time I changed
Code:
//Close and output PDF document

$pdf->Output('articles.pdf', 'I');

to
Code:
//Close and output PDF document

$pdf->Output('articles'.$sid.'.pdf', 'I');
  
Back to top
View user's profile Send private message
sortilege2021
Regular
Regular


Joined: Nov 25, 2010
Posts: 16

Reputation: 5.6Reputation: 5.6Reputation: 5.6Reputation: 5.6Reputation: 5.6

PostPosted: Sun Feb 13, 2011 11:45 pm 
Post subject:
Reply with quote

Short URL only work once then disappears
  
Back to top
View user's profile Send private message
bobby
Site Admin
Site Admin


Joined: Jan 20, 2009
Posts: 600
Location: North Carolina
Reputation: 543Reputation: 543Reputation: 543
votes: 4

PostPosted: Mon Feb 14, 2011 8:16 am 
Post subject:
Reply with quote

Try disabling the short url for the bookmarks. It seems that goo.gl delays the url if too many requests are make for it.
_________________
Tricked Out News
  
Back to top
View user's profile Send private message
sortilege2021
Regular
Regular


Joined: Nov 25, 2010
Posts: 16

Reputation: 5.6Reputation: 5.6Reputation: 5.6Reputation: 5.6Reputation: 5.6

PostPosted: Mon Feb 14, 2011 2:12 pm 
Post subject:
Reply with quote

i still have the same problem
  
Back to top
View user's profile Send private message
bobby
Site Admin
Site Admin


Joined: Jan 20, 2009
Posts: 600
Location: North Carolina
Reputation: 543Reputation: 543Reputation: 543
votes: 4

PostPosted: Mon Feb 14, 2011 2:17 pm 
Post subject:
Reply with quote

Give it a little while. They will resume normal speed to your site after about 15 minutes. I have already had the discussion with the developers at goo.gl. I plan on storing the short url in a database and retrieving it from there for the news. That will be released in the near future.
_________________
Tricked Out News
  
Back to top
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic   print    Tricked Out News Forum Index -> Tricked Out News All times are GMT - 5 Hours
 
 Page 1 of 1

 

Jump to:   
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 cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
Forums ©