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:
33
core/db.cpp
33
core/db.cpp
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user