Member
Member
vincent3569   18-03-2014, 09:11
#1

hi,
with zpbase 0.95 on zenphoto 1.4.6, there is a fatal error on news category.
the theme uses a deprecated function :

Fatal error: Call to undefined function printNewsBreadcrumb() in /public_html/zenphoto_dev/themes/zpbase/news.php on line 65

Administrator
Administrator
acrylian   18-03-2014, 10:05
#2

That has been renamed as the name was misleading because it does not print any breadcrumb. It is now named printNewsTitle()(again).

Member
Member
gjr   18-03-2014, 13:08
#3

Thanks Vincent.

@Acrylian: printNewsBreadcrumb is not listed as deprecated. printNewsTitle is not a replacement as they do very different things. printNewsBreadcrumb (pasted below) prints "Archive" in the breadcrumb when applicable, or "News" or custom name for News. I think this function or a version there of is very much needed. I am wondering if it was removed by mistake (since not listed in deprecated file). PrintNewsTitle prints the title of a single news item, very different.

`
/**

  • Prints the full link of the news index page (news page 1)
  • @param string $name The linktext
  • @param string $before The text to appear before the link text
    */
    function printNewsBreadcrumb($name = NULL, $before = '', $archive = NULL) {
    global $_zp_post_date;
    if ($_zp_post_date) {
    if (is_null($archive)) {
    $name = '[i]' . gettext('Archive') . '[/i]';
    } else {
    $name = strip_tags(html_encode($archive));
    }
    $link = zp_apply_filter('getLink', rewrite_path(ARCHIVE . '/', "/index.php?p=archive"), 'archive.php', NULL);
    } else {
    if (is_null($name)) {
    $name = gettext('News');
    } else {
    $name = strip_tags(html_encode($name));
    }
    $link = getNewsIndexURL();
    }
    if ($before) {
    echo '' . html_encode($before) . '';
    }
    echo "" . $name . "";
    }
    `
Member
Member
gjr   18-03-2014, 13:14
#4

This is the context I use it at the top of news.php loop:

`

`

Administrator
Administrator
acrylian   18-03-2014, 13:21
#5

On the current 1.4.6 build there is actually no printNewsBreadcrumb anymore, it has been renamed as I said. No mistake actually. See the news.php of Zenpage theme how we do it actually.

News articles don't have any breadcrumb anyway as they have no hierachy, only pages and categories have. For those there is printZenpageItemsBreadcrumb() for that purpose.

Member
Member
gjr   18-03-2014, 13:40
#6

OK I see now that printNewsIndexURL replaces it, not printNewsTitle.

Looks like printNewsIndexURL is an exact duplication of the former printNewsBreadcrumb.

Had not caught this before because printNewsBreadcrumb is not showing up deprecated.

Administrator
Administrator
acrylian   18-03-2014, 13:45
#7

Yes, sorry, my mistake answering inbetween. It was not deprecated but just renamed (actually it was named that before) as it "breadcrumb" was misleading as it does not print a real breadcrumb in the meainig of hierachical links.

Member
Member
sbillard   18-03-2014, 17:13
#8

It is not deprecated because it "never really existed". We had deprecated the prior in 1.4.6 function in favor of printNewsBreadcrumb, but the team voted that this was a misleading name so it went back as on 1.4.5. No deprecation because printNewsBreadcrumb was never a released function.

Member
Member
gjr   18-03-2014, 18:22
#9

Oh OK got it. I started patching my theme for 1.4.6 early, that is why. Thanks!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.