https://www.icyphoenix.com/viewtopic.php?f=2&t=9632&p=60779#p60779
-----------------------------------
MWE_001
Sun 21 Aug, 2016 07:11

Sitemap
-----------------------------------
I am kind of anxious to get my sitemap working properly. B UT, there is an error that I mentioned before but I did it in my posting here and there days so I will ask this one again in the proper place which is right here for all to see in General support. 

If I go to sitemap.php I get this

[code linenumbers=false]
[Icy Phoenix Debug] PHP Notice: in file /sitemap.php on line 270: include(ALBUM_MOD_PATHalbum_common.php): failed to open stream: No such file or directory
[Icy Phoenix Debug] PHP Notice: in file /sitemap.php on line 270: include(ALBUM_MOD_PATHalbum_common.php): failed to open stream: No such file or directory
[Icy Phoenix Debug] PHP Notice: in file /sitemap.php on line 270: include(): Failed opening 'ALBUM_MOD_PATHalbum_common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/php55/lib/php')
[/code]

Here is the line in question: [code linenumbers=false]include(ALBUM_MOD_PATH . 'album_common.' . PHP_EXT);[/code] 

Is this line a mistake? As we all know, there is no longer a Album_Mod folder where the album_common.php once used to live.

If I remove this bit of code the sitemap.php will work as it is supposed to.

[code linenumbers=false]
// MG SITEMAP - ALBUM - BEGIN
	if (isset($cms_config_layouts['album']['view']) && ($cms_config_layouts['album']['view'] == AUTH_ALL))
	{
		// Get general album information
		include(ALBUM_MOD_PATH . 'album_common.' . PHP_EXT);
		$album_user_id = ALBUM_PUBLIC_GALLERY;
		//$album_user_id = ALBUM_ROOT_CATEGORY;
		$catrows = array ();
		$options = ALBUM_READ_ALL_CATEGORIES|ALBUM_AUTH_VIEW;
		$catrows = album_read_tree($album_user_id, $options);
		album_read_tree($album_user_id);
		$allowed_cat = ''; // For Recent Public Pics below
		for ($i = 0; $i < sizeof($catrows); $i++)
		{
			$allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id'];
		}

		if($config['sitemap_sort'] == 'ASC')
		{
			$order = 'DESC';
		}
		else
		{
			$order = 'ASC';
		}
		$sql = "SELECT pic_id FROM " . ALBUM_TABLE . "
						WHERE pic_cat_id IN (" . $allowed_cat . ")
						ORDER BY pic_id $order LIMIT 1";
		$result = $db->sql_query($sql);
		$result = $db->sql_fetchrow($result);
		$lastid = $result['pic_id'];

		//only get a limited number of pics per query (default 250) to keep server load down in case of large boards
		while($lastpic != $lastid)
		{
			$result = '';
			//Newest pics first
			if(is_numeric($lastpic) && $config['sitemap_sort'] == 'ASC')
			{
				$lastpic++;
				$wheresql = "AND p.pic_id >= $lastpic";
			}
			//Oldest pics first
			elseif(is_numeric($lastpic))
			{
				$lastpic--;
				$wheresql = "AND p.pic_id <= $lastpic";
			}
			else
			{
				$wheresql = "";
			}

			$sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_time, p.pic_lock
							FROM " . ALBUM_TABLE . " AS p
							WHERE p.pic_cat_id IN (" . $allowed_cat . ") $wheresql
							ORDER BY p.pic_id " . $config['sitemap_sort'] . "
							LIMIT " . $config['sitemap_topic_limit'];
			$result = $db->sql_query($sql);

			while ($row = $db->sql_fetchrow($result))
			{
				$pic_priority = $config['sitemap_default_priority'];
				$pic_change = 'never';
				if (($config['url_rw'] == '1') || (($config['url_rw_guests'] == '1') && ($user->data['user_id'] == ANONYMOUS)))
				{
					$url = $server_url . str_replace ('--', '-', make_url_friendly($row['pic_title']) . '-asp' . $row['pic_id'] . '.html');
				}
				else
				{
					$url = $server_url . 'album_showpage.' . PHP_EXT . '?pic_id=' . $row['pic_id'];
				}
				$xml_sitemap_body .= '
	<url>
		<loc>' . $url . '</loc>
		<lastmod>' . gmdate('Y-m-d\TH:i:s' . '+00:00', $row['pic_time']) . '</lastmod>
		<changefreq>' . $pic_change . '</changefreq>
		<priority>' . $pic_priority . '</priority>
	</url>';
				$lastpic = $row['pic_id'];
			}
			$db->sql_freeresult();
		}
	}
	// MG SITEMAP - ALBUM - END
[/code]

That really seems like overkill to remove that much code no?


