Great, that worked!
I hadn't noticed about the images not working until now. I had thought they were being reposted on my other script, but I guess they're not either. That's definitely something to work on.
I'll take a look at it too.
I'm looking right now at the database table
os_t_item_resource, which stores images/picture references. I see how pictures are 'attached' to items.
For some reason, when we're reposting an ad, new entries are
not being made for the new ad. So somehow we need to write the the "expired" ad photo references to this table for the reposted ad.
IdeaI think if we just implement a new function when the "republish" happens that: Gets all
s_name's (photo names) from the
os_t_item_resource table for the "expired" ad. Then inserts them back into the same table with the new ad's ID (fk_i_item_id). That would do it. Probably easier said than done though!
Perhaps this could be done with a new database table.... run one function before publishing the new ad, which can read and store the needed photo values and ID of the "expired" ad that we're reposting. Then after the ad is posted, with another function we can then see what the "new" ad's ID is, then go back to our database table and take care of writting the "old" ad's photos values to a new entry into the table os_t_item_resource. ............ otherwise, I'm not sure how we can get both the "old" and "new" ad ID's to do all this. Another alternative would be to modify the add() function within the core file
ItemActions.php, which seems even more challenging.
UPDATE: I've been working on my 'idea', and have modified the plugin so it now inserts a needed table. It also will read the expired ad's ID when the user goes to repost. It then can look into the
os_t_item_resource table to get the needed information for the photos. That's where I left off... it's now about 5am and I have a dentist appt at 11am, so better get some sleep!
I'm not sure if this is even the best option, so I'll wait to hear if you do anything more tomorrow. I can certainly continue on this tomorrow (Friday).