Code Monkey home page Code Monkey logo

activitystreams-php's People

Contributors

dracoblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activitystreams-php's Issues

Add possibility to delete a Activity

I could not find a method to delete a Activity, so I had to add a workaround.

It would be good to add the possibility to delete Activity by ID or by other fields inside the activity table, such as stream_id, actor_id, object_id, verb, and so on.

I needed this feature because I wanted to delete a activity without deleting the object from the database because it could be used by other activities.

So, in my Yii Framework component wrapper for the Activity Stream client, I've added the following method:

public function deleteActivityByValues($values=array()) { if (count($values)==0) return false; $criteria=new CDbCriteria(array( 'limit'=>1, )); $values['application_id']=$this->application_id; foreach ($values as $k => $v) { $criteria->addCondition("$k=:$k"); $criteria->params[$k]=$v; } return ActivityStreamActivity::model()->deleteAll($criteria); }

And now I can call the following to delete a Activity from a certain Stream related to a certain Object:
Yii::app()->as->deleteActivityByValues(array( 'stream_id'=>$stream->getId(), 'object_id'=>$object->getId(), ));

Prevent showing again the same activities when loading the next page of activities

Right now I've got a profile page where I show one users latest activities. At the bottom of the page there's a "load more" button that loads with ajax the next "page" of activities.

So the ajax call basically runs the getFeed method with a different offset.

The problem I find is that if in the meanwhile more activities were created, or were deleted, then when we load the new ones, we will either repeat some activities that were already shown, or we skip some activities that haven't been shown yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.