removed: hidden variable 'old_url' in emacs template

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@527 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-11-18 01:58:38 +00:00
parent 13b0204427
commit 848afac803
7 changed files with 93 additions and 25 deletions

View File

@@ -821,6 +821,39 @@ void Db::GetItems(std::vector<Item> & item_table, long parent_id, Item::Type typ
}
// how many items there are in a 'parent_id' directory
long Db::Size(long parent_id, Item::Type type)
{
PGresult * r = 0;
int res = 0;
try
{
AssertConnection();
std::ostringstream query;
query << "select count(id) from core.item where ";
if( type != Item::none )
query << "type='" << (int)type << "' and ";
query << "parent_id='" << parent_id << "';";
r = AssertQuery( query.str() );
AssertResultStatus(r, PGRES_TUPLES_OK);
res = atol(AssertValue(r, 0, 0));
}
catch(const Error &)
{
}
ClearResult(r);
return res;
}
// !! ta chyba nie uzywana juz?
void Db::GetItem(std::vector<Item> & item_table, long id)
{