11
Peekay
Re: Obituaries module
  • 2008/4/6 0:08

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Well, I reached a dead end with the category change issue.

I can see how modlisting.php generates a drop-down menu of the categories around line 157:

$mytree->makeMySelBox("title""title"$cide);

This generates menu options of

My Old School
-- Classmates
-- Obituary

Selecting a new category changes the category ID properly, but I need to get the text of the selected option into a variable to update the 'school' row in the DB.

I have absolutely no idea how to do that!
A thread is for life. Not just for Christmas.

12
Peekay
Re: Obituaries module
  • 2008/4/13 14:50

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


OK, if you have ONE school in Alumni and want to implement my obituary category solution, create 2 sub-cats under the school called 'Classmates' and 'Obituary'.

modlisting.php
Line 316

Replace:

$xoopsDB->query("update ".$xoopsDB->prefix("alumni_listing")." set cid='$cat', name='$name', mname='$mname', lname='$lname', year='$year', studies='$studies', activities='$activities', extrainfo='$extrainfo', occ='$occ', date='$date', email='$email', submitter='$submitter', town='$town', valid='$valid', photo='$photo_old', photo2='$photo2_old' where lid=$lid");


with:

// pk set school var

        
if($cat == '2') {
        
$school "Obituary";
        }
        else {
        
$school "Classmates";
        }

// pk update school var

$xoopsDB->query("update ".$xoopsDB->prefix("alumni_listing")." set cid='$cat', name='$name', mname='$mname', lname='$lname', school='$school', year='$year', studies='$studies', activities='$activities', extrainfo='$extrainfo', occ='$occ', date='$date', email='$email', submitter='$submitter', town='$town', valid='$valid', photo='$photo_old', photo2='$photo2_old' where lid=$lid");


admin/index.php
Line 349

Replace:

$xoopsDB->query("update ".$xoopsDB->prefix("alumni_listing")." set cid='$cat', name='$name', mname='$mname', lname='$lname', year='$year', studies='$studies', activities='$activities', extrainfo='$extrainfo', occ='$occ', date='$date', email='$email', submitter='$submitter', town='$town', valid='$valid', photo='$photo', photo2='$photo2' where lid=$lid");


with:

// pk set school var
        
        
if($cat == '2') {
        
$school "Obituary";
        }
        else {
        
$school "Classmates";
        }

// pk update school var

$xoopsDB->query("update ".$xoopsDB->prefix("alumni_listing")." set cid='$cat', name='$name', mname='$mname', lname='$lname', year='$year', school='$school', studies='$studies', activities='$activities', extrainfo='$extrainfo', occ='$occ', date='$date', email='$email', submitter='$submitter', town='$town', valid='$valid', photo='$photo', photo2='$photo2' where lid=$lid");


I also changed the 'School' column header to 'Group'.

language/english/main.php

change

define("_ALUM_SCHOOL","School");
define("_ALUM_SCHOOL2","School");

to

define("_ALUM_SCHOOL","Group");
define("_ALUM_SCHOOL2","Group");

Now admin, or users, can move listings into the alumni obituary if required.

Now I just need to write some conditional statements to stop the 'contact me' link from appearing if someone is dead!
A thread is for life. Not just for Christmas.

13
Peekay
Re: Obituaries module
  • 2008/4/13 16:57

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


To hide the email contact link on listings in the obituary category:

index.php
Line 419

replace:

$xoopsTpl->assign('contact_head'_ALUM_CONTACT);
$xoopsTpl->assign('contact_email'"contact.php?lid=$lid">"._ALUM_BYMAIL2."");


with:

// pk hide email contact link for obituary category

      
if($cid == '2') {
      } else {
      
$xoopsTpl->assign('contact_head'_ALUM_CONTACT);
      
$xoopsTpl->assign('contact_email'"contact.php?lid=$lid">"._ALUM_BYMAIL2."");
      }
A thread is for life. Not just for Christmas.

Login

Who's Online

130 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 130


more...

Donat-O-Meter

Stats
Goal: AU$15.00
Due Date: Jun 30
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Make donations with PayPal!

Latest GitHub Commits